String Length (length)
The length property returns the number of characters in a string.
- toUpperCase(): Converts the string to uppercase.
- toLowerCase(): Converts the string to lowercase.
Searching and Extracting
- indexOf(): Returns the index of the first occurrence of a substring.
- lastIndexOf(): Returns the index of the last occurrence of a substring.
- substring(): Extracts a portion of a string based on indices.
replace(): Replaces a specified substring with another string.
trim(): Removes leading and trailing spaces from a string.
Splitting and Joining
- split(): Divides a string into an array of substrings based on a delimiter.
- join(): Joins array elements into a string using a specified delimiter.
- includes(): Checks if a substring exists in the string.
- startsWith(): Checks if a string starts with a specified substring.
- endsWith(): Checks if a string ends with a specified substring.