Functions to read and manipulate string variables.
guid
Create a random guid.
guid2
Create a random guid in base64 RFC7515 format.
md5(text)
A utility function that takes a single input, converts it to a string, processes it through the MD5 hashing algorithm, and returns the hash value as an uppercase hexadecimal string. If provided with incorrect arguments, it returns null.
sha256(text)
A utility function that takes a single input, converts it to a string, processes it through the SHA256 hashing algorithm, and returns the hash value as an uppercase hexadecimal string. If provided with incorrect arguments, it returns null.
Template literal (template strings)
Template literals are strings that can cross multiple lines and easily bind in values through single JS expressions inside the string. The strings are started and ended with the ` symbol. Expressions are started with $ inside the string.
textDecode(bytes, encoding)
Converts a byte array to a string using the specified encoding.
textEncode(text, encoding)
Converts a string into bytes using the specified encoding.
toHtml(text, text2, ...)
Converts multi line plain text to HTML.
encodeFilename(filename)
Encode a filename by replacing characters not allowed in filenames with their ASCII code representations. Reverse function of DecodeFilename.
decodeFilename(filename)
Decode an encoded filename string by replacing ASCII code representations with symbols (not allowed in filenames). Reverse function of EncodeFilename.
encodeURI(text)
Encodes a URI by replacing certain characters by escape sequences representing the UTF-8 encoding of the characters.
encodeURIComponent(text)
Encodes a URI by replacing certain characters by escape sequences representing the UTF-8 encoding of the characters.
htmlAttributeEncode(text)
The HtmlAttributeEncode method encodes characters appropriate for insertion into an HTML attribute value
htmlEncode(text)
Converts a string into an HTML-encoded string.
removeEmptyLines(text)
Remove all empty lines (if any) from a string.
String.concat(string1, string2, ...)
Combines multiple strings into one string. Function may be called with one or a "whole bunch" of strings in as parameters.
String.includes(search)
The includes() method returns true if a string contains a specified string.
String.substring(start, end)
The substring() method returns a part of the string between the start and end indexes, or to the end of the string.
String.indexOf(text)
Searches the entire calling string, and returns the index of the first occurrence of the specified substring.
String.lastIndexOf(text)
Searches for last occurence of a substring within a string.
Repeats a string a specified number times and returns the new value.
String.replace(find, replace)
Replaces specified text in a specific string with another text.
String.split(seperator)
Splits a single string into an array of strings based on specified seperator.
String.endsWith(text)
Searches the end of the string, and returns a boolean that is True if the string ends with this text otherwise False.
String.startsWith(text)
Searches the start of the string, and returns a boolean that is True if the string starts with this text otherwise False.
String.trim
Removes spaces before and after a text in a string.
stripTags(html)
Removes all tags from a string
urlEncode(text)
Converts a string into a URL-encoded format, replacing unsafe characters with a percent sign followed by two hexadecimal digits representing the character's ASCII code.