Methods
-
<static> camelize(str)
-
Make a string camelized
Parameters:
Name Type Description str
String The string to camelize
Returns:
The camelized string
- Type
- String
-
<static> endsWith(str, end)
-
Test that a string ends with another string
Parameters:
Name Type Description str
String The string to test
end
String The string to look for at the end
Returns:
True if «str» ends with «end»
- Type
- Boolean
-
<static> escape(str)
-
Escape the html in a string (fast)
Parameters:
Name Type Description str
String The text to escape
Returns:
The escaped text
- Type
- String
-
<static> escapeHTML(str)
-
Escape the html in a string (robust)
Parameters:
Name Type Description str
String The text to escape
Returns:
The escaped text
- Type
- String
-
<static> fromJSON(json)
-
Converts a JSON string into an object
Parameters:
Name Type Description json
String The JSON string to parse
Returns:
The object
- Type
- Object
-
<static> shorten(str, length)
-
Shorten a string to a maximum length
Parameters:
Name Type Description str
String The text to shorten
length
int The maximum length
Returns:
The shortened text, '' if undefined or null string
- Type
- String
-
<static> startsWith(str, start)
-
Test that a string start with another string
Parameters:
Name Type Description str
String The string to test
start
String The string to look for at the start
Returns:
True if «str» starts with «start»
- Type
- Boolean
-
<static> toJSON(obj)
-
Converts an object into a JSON string
Parameters:
Name Type Description obj
Object the object to convert
Returns:
A JSON representation
- Type
- String
-
<static> trim(str)
-
Trim whitespace including unicode chars
Parameters:
Name Type Description str
String The text to trim
Returns:
The trimmed text
- Type
- String
-
<static> wrap(str)
-
Inserts invisible break chars in string so it will wrap
Parameters:
Name Type Description str
String The text to wrap
Returns:
The wrapped text
- Type
- String