Namespace: string

hui. string

Source:

Methods


<static> camelize(str)

Make a string camelized

Parameters:
Name Type Description
str String

The string to camelize

Source:
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

Source:
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

Source:
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

Source:
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

Source:
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

Source:
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

Source:
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

Source:
Returns:

A JSON representation

Type
String

<static> trim(str)

Trim whitespace including unicode chars

Parameters:
Name Type Description
str String

The text to trim

Source:
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

Source:
Returns:

The wrapped text

Type
String