This namespace contains commonly used string utility methods.
Methods
-
<static> contains(str, contains, ignoreCase) → {boolean}
-
Checks if the supplied string contains the exact given substring.
Parameters:
Name Type Argument Default Description strstring The string to check. containsstring The string to check for. ignoreCaseboolean <optional>
false Whether or not to ignore casing when performing the check. Returns:
- Type
- boolean
-
<static> contains(str, contains, ignoreCase) → {boolean}
-
Checks if the supplied string contains the given substring.
Parameters:
Name Type Argument Default Description strstring The string to check. containsstring The string to check for. ignoreCaseboolean <optional>
false Whether or not to ignore casing when performing the check. Returns:
- Type
- boolean
-
<static> containsWord(str, word, ignoreCase) → {boolean}
-
Checks if the supplied string contains the given word.
Parameters:
Name Type Argument Default Description strstring The string to check. wordstring The word to check for. ignoreCaseboolean <optional>
false Whether or not to ignore casing when performing the check. Returns:
- Type
- boolean
-
<static> escapeRegExp(str) → {string}
-
Escapes a string for use in a regular expression.
Parameters:
Name Type Description strstring The string to escape. Returns:
- Type
- string
-
<static> from(str, from) → {string}
-
Returns the remainder of a string split on the first index of the given substring.
Parameters:
Name Type Description strstring The string to split. fromstring The substring to split on. Returns:
- Type
- string
-
<static> random(prefix) → {string}
-
Generates a random string 9 characters long using the optional prefix if supplied.
Parameters:
Name Type Argument Description prefixstring <optional>
The prefix to append to the 9 random characters. Returns:
- Type
- string
-
<static> startsWith(str, prefix) → {boolean}
-
Checks if a string starts with the supplied prefix.
Parameters:
Name Type Description strstring The string to check. prefixstring The prefix to check for. Returns:
- Type
- boolean
-
<static> toCamelCase(str) → {string}
-
Takes the supplied string and converts it to camel case.
Parameters:
Name Type Description strstring The string to camel case. Returns:
- Type
- string