String source

Methods

contains(content) → {boolean} source

Determines whether a substring exists within this string.

Parameters:
Name Type Description
content string
Returns: boolean

whether this string contains the given content

endsWith(substring) → {boolean} source

Returns whether this string ends with a given substring.

Parameters:
Name Type Description
substring string

a potential substring of this string

Returns: boolean

whether this string ends with the given substring

equals(that) → {boolean} source

Returns true if the two strings are equal, otherwise returns false.

Parameters:
Name Type Description
that Object

The object to compare to the string.

Returns: boolean

Returns true if the string is equal to that.

startsWith(substring) → {boolean} source

Returns whether this string begins with a given substring.

Parameters:
Name Type Description
substring string

a potential substring of this string

Returns: boolean

whether this string starts with the given substring

toCapitalized() → {string} source

Capitalizes the first letter in the string.

Returns: string

The original string with its first letter capitalized.

Example
var fname = "abe";
var lname = "lincoln";
var name = fname.toCapitalized() + " " + lname.toCapitalized();
// name == "Abe Lincoln"

Generated from v0.14.14

Need help?

Can't find what you are looking for? Please contact us, we're more than happy to help answer your questions.