This method returns a characters present in the specified location.
Example for charAt:
var v='palle technologies'
alert(v.charAt(1)) ; //displays 'a' as output since second character in the given string is 'a'.
This function returns ASCII value of a character present in the specified position.
var v='palle technologies';
alert(v.charCodeAt(1));//displays out put as 97 since character present in index 1 is a , whose ASCII value is 97.
This function returns concatenated value of two or more strings.
Hence the above code returns skillguntechnologies as output.
This function gives starting position or index of a character or a string in a given string. You can choose position from which searching must start.
The following code displays -1 as output since indexOf method starts searching for character 'k' from 4th index or from 5th position. indexOf function returns -1 when there is no match found.
The following code displays 2 as output since char 'i' is existing in 3rd place or in 2nd index.
The lastIndexOf() method returns the index of the last occurrence of a specified character or string in a given string.
Note: indexOf() and the lastIndexOf() methods return -1 if the text is not found.
The following code displays 4 as output since last occurrence of char 'l' is present in 5th position or 4th index place.
This method used for replacing a single character or multiple character with other single character or multiple characters.
Example: The following code replaces character [d] with character [t] and displays cat as output.
Example: The following code displays 8 as output since the string ('playing') for which we are searching is present in 8th index place in a given string.
var v='manasvi playing with her friends';
Example: The following code returns total 4 characters from 3rd position and hence output is "illg".
limit is total number of array elements which must be produced by the split method.
Example: The following code returns an array with the elements.
This function returns specified number of characters from the given start position.
Start refers to the start position from which characters must be taken and count refers to the total number of characters which must be returned back to the callers of the function.
This method returns series of characters present between specified start index and specified end index.
In the following sample substring method returns "killg" as output that is from 1st index to 6th index.