Skip to main content

String

capitalize(string)#

Converts the first character of string to upper case and the remaining to lower case.

Arguments
string (string): The string to capitalize.

Returns
(string): Returns the capitalized string.

uppercase(string)#

Converts string, as space separated words, to upper case.

Arguments
string (string): The string to convert.

Returns
(string): Returns the upper cased string.

lowercase(string)#

Converts string, as space separated words, to lower case.

Arguments
string (string): The string to convert.

Returns
(string): Returns the lower cased string.

replace(string, pattern, replacement)#

Replaces matches for pattern in string with replacement.

Arguments
string (string): The string to modify.
pattern (string): The pattern to replace.
replacement (string): The match replacement.

Returns
(string): Returns the modified string.

length(string)#

Return the number of characters in a string.

Arguments
string (string): The string to process.

Returns
(number): Returns the length of the processed string.

split(string)#

Splits the string by separator.

Arguments
string (string): The string to split. separator (string): The separator pattern to split by.

Returns
(array): Returns the string segments.

escape(string)#

Converts a JavaScript object or value to a JSON string.

Arguments
string (string): The value to convert to a JSON string.

Returns
(string): Returns a JSON string representing the given value.

toNumber(string)#

Converts value to a number.

Arguments
string (string): The value to process.

Returns
(number): Returns the number.


If you get stuck at a point above, please reach out to support@butternut.tech or via this form.
We're here to support you, and together we can build great things.