str

Methods

(inner) containsAlpha(string, countopt) → {Boolean}

Source:
Check if the string contains at least N letters (case insensitive).
Parameters:
Name Type Attributes Default Description
string string String to test.
count number <optional>
1 Minimum number of letters to return true.
Returns:
Type
Boolean

(inner) containsDigits(string, countopt) → {Boolean}

Source:
Check if the string contains at least N digits.
Parameters:
Name Type Attributes Default Description
string string String to test.
count number <optional>
1 Minimum number of digits to return true.
Returns:
Type
Boolean

(inner) isNumber(string, decimalSeparator) → {boolean}

Source:
Test if the string represent a valid number.
Parameters:
Name Type Description
string string String to be tested
decimalSeparator string Character used as decimal separator, default = '.'
Returns:
String is a number?
Type
boolean

(inner) pad(string, newLength, padChar) → {string}

Source:
Append the given char into the left of the string so change its length to the provided value. ex: pad('10', 4, '-'); //> '--10'
Parameters:
Name Type Description
string string String to be padded
newLength number Length of the padded string
padChar string Char used to pad the string, default = '0'
Returns:
Padded string
Type
string

(inner) toNumber(String) → {number|NaN}

Source:
Convert a string to a number on a pretty lenient way.
Parameters:
Name Type Description
String string to be converted
Returns:
Number or NaN if not possible
Type
number | NaN