Namespace: stax

stax

Stax
Source:

Methods

(static) capitalize(text) → {string}

Converts the first character to upper case
Parameters:
Name Type Description
text string Input string
Source:
Returns:
String with the first character capitalized.
Type
string

(static) casefold(text) → {string}

Converts string into lower case
Parameters:
Name Type Description
text string Input string
Source:
Returns:
Lower case string.
Type
string

(static) center(text, width) → {string}

Returns a centered string
Parameters:
Name Type Description
text string Input string
width number Total width to center the string within
Source:
Returns:
Centered string.
Type
string

(static) count(text, value) → {number}

Returns the number of times a specified value occurs in a string
Parameters:
Name Type Description
text string Input string
value string Value to count in the string
Source:
Returns:
Count of occurrences.
Type
number

(static) endswith(text, suffix) → {boolean}

Returns true if the string ends with the specified value
Parameters:
Name Type Description
text string Input string
suffix string Suffix to check
Source:
Returns:
True if the string ends with the specified value.
Type
boolean

(static) expandtabs(text, tabsize) → {string}

Sets the tab size of the string
Parameters:
Name Type Description
text string Input string
tabsize number Number of spaces per tab
Source:
Returns:
String with expanded tabs.
Type
string

(static) find(text, value) → {number}

Searches the string for a specified value and returns the position of where it was found.
Parameters:
Name Type Description
text string Input string
value string Value to search for
Source:
Returns:
Position of the found value, or -1 if not found.
Type
number

(static) format(template, …values) → {string}

Formats specified values in a string
Parameters:
Name Type Attributes Description
template string Template string with placeholders
values any <repeatable>
Values to replace placeholders
Source:
Returns:
Formatted string.
Type
string

(static) isalnum(text) → {boolean}

Returns True if all characters in the string are alphanumeric
Parameters:
Name Type Description
text string Input string
Source:
Returns:
True if the string is alphanumeric.
Type
boolean

(static) isalpha(text) → {boolean}

Returns True if all characters in the string are alphabetic
Parameters:
Name Type Description
text string Input string
Source:
Returns:
True if the string is alphabetic.
Type
boolean

(static) isdigit(text) → {boolean}

Returns True if all characters in the string are digits
Parameters:
Name Type Description
text string Input string
Source:
Returns:
True if the string consists of digits.
Type
boolean

(static) lower(text) → {string}

Converts a string into lower case
Parameters:
Name Type Description
text string Input string
Source:
Returns:
Lower case string.
Type
string

(static) strip(text) → {string}

Returns a trimmed version of the string
Parameters:
Name Type Description
text string Input string
Source:
Returns:
Trimmed string.
Type
string

(static) upper(text) → {string}

Converts a string into upper case
Parameters:
Name Type Description
text string Input string
Source:
Returns:
Upper case string.
Type
string

(static) zfill(text, width) → {string}

Fills the string with a specified number of 0 values at the beginning
Parameters:
Name Type Description
text string Input string
width number Total width of the string after padding
Source:
Returns:
Padded string.
Type
string