GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing www.geeksforgeeks.org — JavaScript String Methods - GeeksforGeeks JavaScript String MethodsLast Updated : 1 Jun, 2026 JavaScript provides a variety of built-in methods to work with strings — allowing you to extract, modify, search, and format text with ease. Below are some of the most commonly used core string methods: slice()slice() extracts a part of the string based on the given stating-index and ending-index and returns a new string.
substring()substring() returns the part of the given string from the start index to the end index. Indexing starts from zero (0).
substr()substr() This method returns the specified number of characters from the specified index from the given string. It extracts a part of the original string.
replace()replace() replaces a part of the given string with another string or a regular expression. The original string will remain unchanged.
replaceAll()replaceAll() returns a new string after replacing all the matches of a string with a specified string or a regular expression. The original string is left unchanged after this operation.
toUpperCase()toUpperCase() converts all the characters present in the String to upper case and returns a new String with all characters in upper case. This method accepts single parameter stringVariable string that you want to convert in upper case.
toLowerCase()toLowerCase() converts all the characters present in the so lowercase and returns a new string with all the characters in lowercase.
concat()concat() combines the text of two strings and returns a new combined or joined string. To concatenate two strings, we use the concat() method on one object of string and send another object of string as a parameter. This method accepts one argument. The variable contains text in double quotes or single quotes.
trim()trim() is used to remove either white spaces from the given string. This method returns a new string with removed white spaces. This method is called on a String object. This method doesn't accept any parameter.
trimStart()trimStart() removes whitespace from the beginning of a string. The value of the string is not modified in any manner, including any whitespace present after the string.
trimEnd()trimEnd() removes white space from the end of a string. The value of the string is not modified in any manner, including any white-space present before the string.
padStart()padStart() pad a string with another string until it reaches the given length. The padding is applied from the left end of the string.
padEnd()padEnd() pad a string with another string until it reaches the given length. The padding is applied from the right end of the string.
charAt()charAt() returns the character at the specified index. String in JavaScript has zero-based indexing.
charCodeAt()charCodeAt() returns a number that represents the Unicode value of the character at the specified index. This method accepts one argument.
split()split() splits the string into an array of sub-strings. This method returns an array. This method accepts a single parameter character on which you want to split the string.
More JS String MethodsBelow is the JavaScript string functions list:
Also CheckComment Explore | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |