All String Methods In JavaScript

String Methods are methods that are used to manipulate strings in JavaScript. They are used to convert strings to other formats or perform operations like search, replace, split, join, etc.

charAt in Javascript

charAt in JavaScript

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.

charCodeAt in Javascript

charCodeAt in JavaScript

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.

Javascript concat string

JavaScript concat string

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.

Javascript endsWith

JavaScript endsWith Method

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.

Javascript string includes

JavaScript includes() Method

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.

Javascript string indexOf Method

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.

Javascript lastIndexOf Method

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.

Javascript match Method

JavaScript match() Method

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.

Javascript matchAll Method

JavaScript matchAll() Method

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.

Javascript repeat Method

JavaScript repeat() Method

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.

Javascript replace Method

JavaScript replace() Method

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.

Javascript replaceAll Method

JavaScript replaceAll() Method

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...

Javascript string search

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.

Javascript slice method

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.

Javascript string split method

split() Method In JavaScript

The split() method is used to split a string into an array of substrings at the specified separator and returns the array of substrings.

Javascript string and substring

substring() and substr() Method In JavaScript

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.

Javascript startsWith

JavaScript startsWith() Method

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.

Javascript uppercase

JavaScript toUpperCase()

The toUpperCase() method is used to convert a string to uppercase. It returns a new string with all the characters in uppercase.