v7.3.0
SupportExamplesFree Trial

StringHelper

A static utility class providing common string manipulation methods such as HTML encoding, camelCase conversion, regular expression escaping, and markdown-to-HTML processing.

StringHelper.encodeHtml('<script>alert("xss")</script>');
// '<script>alert("xss")</script>'

StringHelper.capitalize('hello'); // 'Hello' StringHelper.hyphenate('fontSize'); // 'font-size'

Useful functions

Function Description
encodeHtml Encode HTML entities in a string
capitalize Capitalize the first letter of a string
hyphenate Convert camelCase string to hyphen-case
escapeRegExp Escape special RegExp characters in a string

See also

No results

Functions

Functions are methods available for calling on the class

    Source path

    Core/helper/StringHelper.js

    Contents