These methods remove whitespace or change letter case.
Removes whitespace from both ends of the string.
| Item | Description |
|---|---|
| Syntax | `string.trim()` |
| Arguments | none |
| Returns | string |
Example:
' abc '.trim(); // 'abc'
Removes whitespace from the start of the string.
| Item | Description |
|---|---|
| Syntax | `string.trimleft()` |
| Arguments | none |
| Returns | string |
Example:
' abc '.trimleft(); // 'abc '
Removes whitespace from the end of the string.
| Item | Description |
|---|---|
| Syntax | `string.trimright()` |
| Arguments | none |
| Returns | string |
Example:
' abc '.trimright(); // ' abc'
Converts letters to uppercase.
| Item | Description |
|---|---|
| Syntax | `string.upper()` |
| Arguments | none |
| Returns | string |
Example:
'abc'.upper(); // 'ABC'
Converts letters to lowercase.
| Item | Description |
|---|---|
| Syntax | `string.lower()` |
| Arguments | none |
| Returns | string |
Example:
'ABC'.lower(); // 'abc'
Previous: String Regex Methods
Next: Objects