JS: String.prototype
What is string.prototype
Purpose of String.prototype is to provide methods and properties useful for all string objects.
Properties
substring
Get character and Unicode
- JS: String.prototype.at (get char at index) ♠
- JS: String.prototype.charAt (get char at index) 👎
- JS: String.prototype.charCodeAt (Char to ID)
- JS: String.prototype.codePointAt (Char to ID)
join, trim, pad
- JS: String.prototype.concat
- JS: String.prototype.repeat
- JS: String.prototype.trim
- JS: String.prototype.trimStart
- JS: String.prototype.trimEnd
- JS: String.prototype.padStart
- JS: String.prototype.padEnd
Search string
- JS: String.prototype.indexOf
- JS: String.prototype.lastIndexOf
- JS: String.prototype.includes
- JS: String.prototype.startsWith
- JS: String.prototype.endsWith
Search / replace with regex
- JS: String.prototype.search
- JS: String.prototype.match
- JS: String.prototype.matchAll
- JS: String.prototype.replace
Convert to array
Convert letter case
- JS: String .prototype .toLowerCase .toUpperCase .toLocaleLowerCase .toLocaleUpperCase
String.prototype.toUpperCaseString.prototype.toLocaleLowerCaseString.prototype.toLocaleUpperCase
misc
String.prototype.toString-
Return the string itself.
String.prototype.valueOf-
Return the string itself.
String.prototype.localeCompare(str)-
Return negative, 0, or positive integer, by comparing this-binding with str, in a locale aware manner.
String.prototype.normalize(form)-
normalize a string according to Unicode Standard Annex #15 Unicode Normalization Forms.
String.prototype[Symbol.iterator]-
return the Iterator Object.