Strings
Utility methods related to Strings.
asLines(string)
escapeHtml(html)
Escapes HTML code.
escapeJson(jsonContents)
Escapes JSON content.
extractValue(prefix, contents, errorOnUndefined)
Iterates over the given string, line-by-line, looking for the given prefix. If found, returns the contents of the line after the prefix.
fromXml(xmlString)
Converts a given XML string to an object.
isEmpty(string)
Taken from here: https://stackoverflow.com/questions/154059/how-do-you-check-for-an-empty-string-in-javascript
normalize(string)
Normalizes a given string:
1) Replaces \r\n with \n
2) Trims lines and removes empty lines
replacer(string, oldSequence, newSequence)
Equivalent to JS 'replace'.
toJson(value)
toXml(object)
Converts a given object to a XML string.
uuid()
Returns a random unique identifier.