StringUtils

StringUtils

Provides string manipulation methods

Constructor

new StringUtils()

Methods

(static) escapeHtmlEntities(text) → {string}

Escapes all HTML entities from a given string.

Parameters:
Name Type Description
text string

The string whose HTML entities are to be encoded.

(static) getAfterLast(string, stopString) → {string}

Returns the string from the last occurence of the stop string until the end. The stop string is not included in the result.

Parameters:
Name Type Description
string string
stopString string

(static) getFrom(string, startString)

Returns the string from the index of the start string until the end of the string. The start character is
not included in the returned string.

If the specified start string is not found in the string, an empty string is returned.

Parameters:
Name Type Description
string string
startString string

(static) getUntil(string, stopString)

Returns the string from the beginning of the string until the specified stop string. The stop string
is not included in the returned string.

If the specified stop string is not found, the whole string is returned.

Parameters:
Name Type Description
string string
stopString string

(static) hashCode()

Js implementation of Java's hashcode (sort of). Somewhat useful for creating
unique ideas that contain [A-Za-z0-9-_]