Skip to content

API reference documentation

fcharest edited this page Apr 30, 2015 · 1 revision

API reference

Functions

equalsIgnoreCase(str1:String, str2:String)

Compares two strings ignoring case. Returns true if they are equals.

Example

utilities.equalsIgnoreCase('Abc', 'abc'); // true

startsWithIgnoreCase(str:String, target:String)

Returns true when target is matched in the provided string.

Example

utilities.startsWithIgnoreCase('Abc', 'a'); // true

capitaliseFirstLetter(str:String) [DEPRECATED:Use lodash's capitalize]

Capitalize the first letter of the provided string.

Example

utilities.capitaliseFirstLetter('abc'); // 'Abc'

uncapitaliseFirstLetter(str:String)

Changes the case of the string's first letter to lower case.

Example

utilities.uncapitaliseFirstLetter('ABC'); // 'aBC'

caseInsensitiveCmp(str1:String, str2:String) [DEPRECATED: Use equalsIgnoreCase]

stripHtmlFromText(str:String)

Removes HTML from the provided string.

Example

utilities.stripHtmlFromText('<h1>Title</h1>'); // 'Title'

trimRight(str:String, pattern:Regex)

Removes whitespaces starting from the right end of the string. When pattern is provided, trims using this pattern instead.

Example

utilities.trimRight('Some text with white space '); // 'Some text with white space'
utilities.trimRight('http://example.com/test/', '/'); // 'http://example.com/test'

toSlug(str:String)

Returns slugified string from the provided string.

Example

utilities.toSlug('This, That & the Other! Various Outré Considerations'); // 'this-that-the-other-various-outre-considerations'