new StringUtils()
Static object that contains helper functions for working with strings.
Methods
(static) isNullOrEmpty(str) → {boolean}
Returns true if the string is null or empty.
Parameters:
Name | Type | Description |
---|---|---|
str |
string | The string to check. |
Returns:
true if the string is null or empty.
- Type
- boolean
(static) isNullOrWhiteSpace(str) → {boolean}
Returns true if the string is null or contains only whitespaces.
Parameters:
Name | Type | Description |
---|---|---|
str |
string | The string to check. |
Returns:
true if the string is null or only whitespaces.
- Type
- boolean
(static) joinFunc(delimiter) → {function}
Returns a function which performs Array.join and can be passed as a continuation.
Parameters:
Name | Type | Description |
---|---|---|
delimiter |
string | The delimiter that should be used for join. |
Returns:
the continuation function that will perform the desired join.
- Type
- function
(static) splitFunc(delimiter) → {function}
Returns a function which performs string.split and can be passed as a continuation.
Parameters:
Name | Type | Description |
---|---|---|
delimiter |
string | The delimiter that should be used for splitting the string to tokens. |
Returns:
the continuation function that will perform the desired split.
- Type
- function
(static) trim(str, charList) → {void}
Removes characters from the left and right of the string.
Parameters:
Name | Type | Description |
---|---|---|
str |
string | The string to remove. |
charList |
string | The characters to remove. |
Returns:
the string after removing the left and right characters.
- Type
- void
(static) trimLeft(str, charList) → {string}
Removes characters from the beginning of the string.
Parameters:
Name | Type | Description |
---|---|---|
str |
string | The string to remove. |
charList |
string | The characters to remove. |
Returns:
the string after removing the left characters.
- Type
- string
(static) trimRight(str, charList) → {string}
Removes characters from the end of the string.
Parameters:
Name | Type | Description |
---|---|---|
str |
string | The string to remove. |
charList |
string | The characters to remove. |
Returns:
the string after removing the right characters.
- Type
- string