string¶
- stringIsEmpty(string)¶
Check if a string is empty or only whitespace.
- Arguments:
string (string) – The string to check.
- Returns:
boolean – Whether the string is empty.
- getCharacterCount(string, characterToCount)¶
Get number of instances of an character in a string.
- Arguments:
string (string) – The string to search.
characterToCount (string) – The character to search for.
- Returns:
number – The number of instances of the character in the string.
- capitalizeString(string)¶
Get a copy of a string with the first letter capitalized.
- Arguments:
string (string) – The string to capitalize.
- Returns:
string – The capitalized string.
- isClockFaceTime(timeString)¶
Determine if a string is a valid clock face time.
- Arguments:
timeString (string) – The string to check.
- Returns:
boolean – Whether the string is a valid clock face time.
- isDateTime(dateTimeString)¶
Determine if a string is a valid date-time.
- Arguments:
dateTimeString (string) – The string to check.
- Returns:
boolean – Whether the string is a valid date-time.
- isNumber(numericString)¶
Determine if a string is a valid number.
- Arguments:
numericString (string) – The string to check.
- Returns:
boolean – Whether the string is a valid number.
- stringTemplate(strings, keys)¶
Parse a template literal string.
Copied from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals.
- Arguments:
strings (Array.<string>) – The literal parts of the template string.
keys (number|string) – The keys of the closure arguments.
- Returns:
function – A closure to fill the string template.