StringUtils.js

Summary
StringUtils.js
Functions
startsWithChecks if the given string starts with a certain prefix.
endsWithChecks if the given string ends with a certain suffix.
trimRemoves leading and trailing whitespace characters from a string.
isEmptyChecks if given string is empty.

Functions

startsWith

startsWith : function(string,
prefix)

Checks if the given string starts with a certain prefix.

Parameters

string{String} String to check.
prefix{String} Prefix.

endsWith

endsWith : function(string,
suffix)

Checks if the given string ends with a certain suffix.

Parameters

string{String} String to check.
suffix{String} Suffix.

trim

trim : function(string)

Removes leading and trailing whitespace characters from a string.

Parameters

string{String} The (potentially) space padded string.  This string is not modified.

Returns

{String} A trimmed version of the string with all leading and trailing spaces removed.

isEmpty

isEmpty : function(string)

Checks if given string is empty.

Returns

true if the string is null, undefined or empty, false otherwise.

Parameters

stringstring to check.
startsWith : function(string,
prefix)
Checks if the given string starts with a certain prefix.
endsWith : function(string,
suffix)
Checks if the given string ends with a certain suffix.
trim : function(string)
Removes leading and trailing whitespace characters from a string.
isEmpty : function(string)
Checks if given string is empty.