Class: H_strings

H_strings

Small utility class for string operations (you'll find it in generics.js).
Provides static methods for string formatting and HTML escaping.
Used as h.libs.strings.

new H_strings()

generics.js, line 290

Methods

staticH_strings.complete_string(str, replace_array){string}

generics.js, line 311
Replaces $1, $2, ... in a string with values from an array.
uses essentialy in translation files to replace $x in sentences.
Name Type Description
str string The string with placeholders.
replace_array Array | string Values to insert.
Returns:
Type Description
string Completed string.

staticH_strings.escape_html(text){string}

generics.js, line 332
Escapes HTML special characters in a string.
Converts <, >, ", and ' to HTML entities.
Name Type Description
text string The text to escape.
Returns:
Type Description
string Escaped string.