JavaScript String
String methods for text manipulation — split, replace, trim, match, and more. Strings represent text in JavaScript and are immutable sequences of UTF-16 code units. This guide covers all methods for manipulating, searching, and transforming string data. Because strings are immutable, every method that appears to modify a string actually returns a new string, leaving the original unchanged. Understanding string methods is essential for form validation, text processing, data parsing, and user interface formatting in any JavaScript application. This category documents 35 JavaScript string entries, and each page gives you the full syntax, the parameter list, the return value, a runnable example, time complexity, and the mistakes developers most often make with that API. String.prototype.charAt() — Returns the character at the specified index. String.prototype.charCodeAt() — Returns the Unicode value of the character at the specified index. String.prototype.concat() — Concatenates strings together. String.prototype.includes() — Checks if a string contains a specified substring. String.prototype.indexOf() — Returns the index of the first occurrence of a specified value. String.prototype.lastIndexOf() — Returns the index of the last occurrence. String.prototype.match() — Retrieves matches of a string against a regular expression. String.prototype.matchAll() — Returns an iterator of all matches. String.prototype.replace() — Replaces matched substring with a new substring. String.prototype.replaceAll() — Replaces all occurrences. String.prototype.search() — Searches for a match and returns the index. String.prototype.slice() — Extracts a section of a string and returns it as a new string. String.prototype.split() — Splits a string into an array of substrings. String.prototype.substring() — Returns a substring between two indices. The entries below cover the full life of a string in JavaScript: creating and slicing, searching and extracting, case and whitespace transforms, pattern matching with regular expressions, Unicode-aware operations, and the newer methods such as replaceAll and at. Each linked page shows the exact signature, what the method returns for edge cases such as missing matches or out-of-range indexes, and the mistakes developers most often make with it. The entries are: String.prototype.charAt(), String.prototype.charCodeAt(), String.prototype.concat(), String.prototype.includes(), String.prototype.indexOf(), String.prototype.lastIndexOf(), String.prototype.match(), String.prototype.matchAll(), String.prototype.replace(), String.prototype.replaceAll(), String.prototype.search(), String.prototype.slice(), String.prototype.split(), String.prototype.substring(), String.prototype.toLowerCase(), String.prototype.toUpperCase(), String.prototype.trim(), String.prototype.trimStart(), String.prototype.trimEnd(), String.prototype.padStart(), String.prototype.padEnd(), String.prototype.startsWith(), String.prototype.endsWith(), String.prototype.repeat(), String.prototype.at(), String.prototype.codePointAt(), String.prototype.localeCompare(), String.prototype.normalize(), String.raw(), String.fromCharCode(), String.fromCodePoint(), String.prototype[Symbol.iterator](), String.prototype.length, String.prototype.valueOf(), String.prototype.toString(). For a structured walkthrough of the whole topic, read the Strings guide.