JavaScript String Methods

In Javascript, a string is a sequence of characters that represents text. Strings can be used to store and manipulate text in your code. They are often used to store user input, display messages to the user, and hold other data that needs to be represented as text.

Strings in javascript have multiple built-in methods that can be used to manipulate and interact with them. Some common string methods include charAt(), which returns the character at a specified index in a string, and indexOf(), which returns the index of the first occurrence of a specified value in a string.

You can use string methods to perform tasks such as extracting specific characters or substrings from a string, searching for specific values within a string, or changing the case of a string. You can also use string methods to format and manipulate strings in more complex ways, such as by splitting a string into an array of substrings or concatenating multiple strings together.

Here is the reference of all the string methods and properties available in javascript.

Javascript String charAt()
Returns character at a specified index in the string.

JavaScript String replace()
replace a substring/pattern in the string.

Javascript String substring()
Returns a specified part of the string.

Javascript String split()
Returns the string divided into a list of substrings.

Javascript String trim()
Returns a new string with removed whitespace from both ends.