On this page
String
Prev: Set | Up: builtins | Next: Math
Rel: String, RegExp & Intl Guide, Prototype Chain & new Flow
Ref: MDN Web Docs — String
Tags: #public #web #javascript #builtins #string #index
Overview
Immutable UTF-16 character sequences with search, slicing, and formatting methods.
Core (#tier/core)
- String.slice — Extracts a substring without mutating
str; supports negative indices from the end. - String.split — Splits
strinto an array of substrings using a string orRegExpdelimiter. - String.includes — Case-sensitive substring presence check returning a boolean.
- String.replaceAll — Replaces all occurrences of a string or global
RegExp(/g) without mutatingstr. - String.trim — Removes leading and trailing Unicode whitespace from
str.
Standard (#tier/standard)
- String.matchAll — Returns a lazy iterator of all regex match objects including capture groups and indices.
Legacy / Avoid (#tier/legacy)
- String.substr — Deprecated Annex B method taking
(start, length)instead of(start, end). Prefer String.prototype.slice().
Linked from
- tuts/javascript/builtins
- tuts/javascript/builtins/Math
- tuts/javascript/builtins/Set
- tuts/javascript/builtins/Set/union
- tuts/javascript/builtins/String/includes
- tuts/javascript/builtins/String/matchAll
- tuts/javascript/builtins/String/replaceAll
- tuts/javascript/builtins/String/slice
- tuts/javascript/builtins/String/split
- tuts/javascript/builtins/String/substr
- tuts/javascript/builtins/String/trim
Related notes
- tuts/javascript/builtins Linked here; links to this page; shared tags: #builtins, #index, #javascript, #web
- tuts/javascript/builtins/Math Linked here; links to this page; shared tags: #builtins, #index, #javascript, #web
- tuts/javascript/builtins/Set Linked here; links to this page; shared tags: #builtins, #index, #javascript, #web
- tuts/javascript/builtins/String/includes Linked here; links to this page; shared tags: #builtins, #javascript, #string, #web
- tuts/javascript/builtins/String/matchAll Linked here; links to this page; shared tags: #builtins, #javascript, #string, #web
- tuts/javascript/builtins/String/replaceAll Linked here; links to this page; shared tags: #builtins, #javascript, #string, #web
- tuts/javascript/builtins/String/slice Linked here; links to this page; shared tags: #builtins, #javascript, #string, #web
- tuts/javascript/builtins/String/split Linked here; links to this page; shared tags: #builtins, #javascript, #string, #web
- tuts/javascript/builtins/String/substr Linked here; links to this page; shared tags: #builtins, #javascript, #string, #web
- tuts/javascript/builtins/String/trim Linked here; links to this page; shared tags: #builtins, #javascript, #string, #web