javascript

String Object


 

A string object represents a sequence of characters and is used to manipulate and work with textual data.


Syntax:

// syntax
var val = new String(value);


Example:

var stringObject = new String('Wasif');

 

There String properties are:

Constructor: It returns a reference to the String function that created the object.
Length: It returns the length of the string.
Prototype: The prototype property allows you to add properties and methods to an object.