Namespace: string

qui.utils.string

Methods

(static) camelize(s) → {String}

Transform a regular text to its camel-case representation.

Parameters:
Name Type Description
s String
Source:
Returns:
Type
String

(static) formatPercent(text, …args) → {String}

Replace percent-formatted placeholders in a string with given values.

Placeholders can be given as "%s", "%d" or "%f", in which case args will be used, in order, to replace them.

Placeholders can also be given as "%(name)s", "%(name)d" or "%(name)f", in which case the first argument in args will be used as an object that maps names to replacement values.

Parameters:
Name Type Attributes Description
text String
args * <repeatable>

values used to replace the placeholders

Source:
Returns:
Type
String

(static) fromUTF8(s) → {String}

Decode a string from UTF8.

Parameters:
Name Type Description
s String
Source:
Returns:
Type
String

(static) intelliSearch(s, search) → (nullable) {RegExpMatchArray}

Intelligently search for an input sequence in a string. All characters in the input sequence must be present in the searched string, in the respective order.

Parameters:
Name Type Description
s String

string to search into

search String

string to search for

Source:
Returns:
Type
RegExpMatchArray

(static) replaceAll(s, oldStr, newStr) → {String}

Replace all occurrences of oldStr in s with newStr.

Parameters:
Name Type Description
s String
oldStr String
newStr String
Source:
Returns:
Type
String

(static) title(s) → {String}

Transform the starting letter of each word of a text to uppercase.

Parameters:
Name Type Description
s String
Source:
Returns:
Type
String

(static) toUTF8(s) → {String}

Encode a string to UTF8.

Parameters:
Name Type Description
s String
Source:
Returns:
Type
String

(static) uncamelize(s, chropt) → {String}

Transform a camel-case string into its dash-separated representation.

Parameters:
Name Type Attributes Description
s String
chr String <optional>

separator character (defaults to dash "-")

Source:
Returns:
Type
String