Class: String

String

new String()

Source:

Members

(static) PADDING :String

Default value used in pad functions.
Type:
Source:

Methods

(static) is(value) → {Boolean}

Determines whether the given value is a string.
Parameters:
Name Type Description
value *
Source:
Returns:
Type
Boolean

assign(object) → {String}

Assigns values from the object into variables in curly braces.
Parameters:
Name Type Description
object Object
Source:
Returns:
Type
String
Example
"{test} {noSuchProperty}".assign({ test: "test value" });
// this results in "test value {noSuchProperty}"

camelize(firstopt) → {String}

Parameters:
Name Type Attributes Default Description
first Boolean <optional>
true
Source:
Returns:
Type
String

capitalize(allopt) → {String}

Parameters:
Name Type Attributes Default Description
all Boolean <optional>
false
Source:
Returns:
Type
String

chars() → {Array.<String>}

Source:
Returns:
An array of chars
Type
Array.<String>

dasherize() → {String}

Source:
Returns:
Type
String

decodeHTML() → {String}

Source:
Returns:
HTML-decoded value
Type
String

decodeURI(partialopt) → {String}

Parameters:
Name Type Attributes Description
partial Boolean <optional>
Source:
Returns:
URI-decoded value
Type
String

encodeHTML() → {String}

Source:
Returns:
HTML-encoded value
Type
String

encodeURI(partialopt) → {String}

Parameters:
Name Type Attributes Description
partial Boolean <optional>
Source:
Returns:
URI-encoded value
Type
String

endsWith(substr, indexopt) → {String}

Parameters:
Name Type Attributes Default Description
substr String
index Number <optional>
this.length
Source:
Returns:
Type
String

normalizeLines() → {String}

Replaces both \r\n & \r by just \n.
Source:
Returns:
Type
String

pad(length, padStringopt) → {String}

Parameters:
Name Type Attributes Default Description
length Number
padString String <optional>
" "
Source:
Returns:
Type
String

padLeft(length, padStringopt) → {String}

Parameters:
Name Type Attributes Default Description
length Number
padString String <optional>
" "
Source:
Returns:
Type
String

padRight(length, padStringopt) → {String}

Parameters:
Name Type Attributes Default Description
length Number
padString String <optional>
" "
Source:
Returns:
Type
String

parametrize(separatoropt) → {String}

Creates an URI-safe identifier from the string.
Parameters:
Name Type Attributes Default Description
separator String <optional>
"-"
Source:
Returns:
Type
String

removeDiacritics() → {String}

Source:
Returns:
Type
String

repeat(times) → {String}

Parameters:
Name Type Description
times Number
Source:
Throws:
RangeError
Returns:
Type
String

repeatUntil(length) → {String}

Parameters:
Name Type Description
length Number
Source:
Throws:
RangeError
Returns:
Type
String

replaceAll(substr, newSubstr) → {String}

Parameters:
Name Type Description
substr String
newSubstr String
Source:
Returns:
Type
String

reverse() → {String}

Source:
Returns:
Type
String

spacify() → {String}

Source:
Returns:
Type
String

startsWith(substr, indexopt) → {String}

Parameters:
Name Type Attributes Default Description
substr String
index Number <optional>
0
Source:
Returns:
Type
String

substr(indexopt, lengthopt) → {String}

Supports negative index.
Parameters:
Name Type Attributes Default Description
index Number <optional>
0
length Number <optional>
Source:
Returns:
Type
String

toFloat() → {Number}

Source:
Returns:
Type
Number

toInt(radixopt) → {Number}

Parameters:
Name Type Attributes Default Description
radix Number <optional>
10
Source:
Returns:
Type
Number

trim(substr, indexopt) → {String}

Parameters:
Name Type Attributes Default Description
substr String
index Number <optional>
0
Source:
Returns:
Type
String

trim() → {String}

Source:
Returns:
Type
String

trimLeft() → {String}

Source:
Returns:
Type
String

trimRight() → {String}

Source:
Returns:
Type
String

underscore() → {String}

Source:
Returns:
Type
String