The charAt() method returns the character at the specified index in a string. It is used to get the character at a particular index in a string.
The charCodeAt() method returns the Unicode value of the character at the specified index in a string. It accepts a single parameter, the index of the character.
The concat() method is used to join two or more strings. It accepts a variable number of arguments and returns a single string by joining them.
The endsWith() method determines whether a string ends with the characters of a specified string or not. It returns true if the string ends with the specified characters, otherwise, it returns false.
The includes() method is used to determine whether a string contains the characters of a specified string, or not. It returns true or false based on the result.
indexOf() String Method
The indexOf() method returns the index of the first occurrence of a specified value in a string. It accepts a single parameter, the value to search for.
lastIndexOf() String Method
The lastIndexOf() method is just like the indexOf method but it returns the index of the last occurrence of the specified value in a string.
The match() method is a very advanced method. It searches a string for a match against a regular expression, and returns the matches, as an array, or null if no match was found.
The matchAll() method is the same as the match() method but it returns all the matches even if you use a string as a matching pattern. While using a regular expression, it is necessary to use the flag g with it.
The repeat() method is used to repeat a string a specified number of times. It returns a string consisting of the specified number of copies of the string on which it is called.
The replace() method is a very useful string method. It searches a string for a specified value, or a regular expression, and returns a new string where all instances of the specified value have been replaced.
The replaceAll() method is the same as replace() method with the difference that it replaces all the matches instead of just the first one. More in detail...
String search() Method
The string search() method is used to search a string for a specified value or a regular expression and returns the position of the match, or -1 if no match was found.
String slice() Method
The string slice() method is used to extract a part of a string and returns a new string. It accepts two parameters, the start index and the end index of the part of the string to extract.
The split() method is used to split a string into an array of substrings at the specified separator and returns the array of substrings.
The substring() and substr() methods are used to extract a part of a string and return a new string. Click here to learn in detail.
The startsWith() method is used to check if a string starts with the specified string. It can do the same thing for any position of the string when the position is specified as the second parameter.
The toUpperCase() method is used to convert a string to uppercase. It returns a new string with all the characters in uppercase.