1.

What Are String Methods?

Answer»

Here is a list of the METHODS available in String object along with their description.

  • charAt(): Returns the character at the specified index.
  • charCodeAt(): Returns a number indicating the UNICODE value of the character at the given index.
  • concat(): Combines the text of two strings and returns a new string.
  • indexOf(): Returns the index within the calling String object of the first occurrence of the specified value, or -1 if not found.
  • lastIndexOf(): Returns the index within the calling String object of the last occurrence of the specified value, or -1 if not found.
  • localeCompare(): Returns a number indicating WHETHER a reference string comes before or after or is the same as the given string in sort order.
  • match(): Used to match a regular expression against a string.
  • replace(): Used to find a match between a regular expression and a string, and to replace the matched substring with a new substring.
  • search(): Executes the search for a match between a regular expression and a specified string.
  • slice(): Extracts a section of a string and returns a new string.
  • split(): Splits a String object into an array of strings by separating the string into substrings.
  • substr(): Returns the CHARACTERS in a string beginning at the specified location through the specified number of characters.
  • substring(): Returns the characters in a string between two indexes into the string.
  • toLocaleLowerCase(): The characters within a string are converted to lower case while respecting the current locale.
  • toLocaleUpperCase(): The characters within a string are converted to upper case while respecting the current locale.
  • toLowerCase(): Returns the calling string value converted to lower case.
  • toString(): Returns a string representing the specified object.
  • TOUPPERCASE(): Returns the calling string value converted to uppercase.
  • valueOf(): Returns the primitive value of the specified object.

Here is a list of the methods available in String object along with their description.



Discussion

No Comment Found