String functions

Functions to read and manipulate string variables.

gui­d

Create a random guid.

guid­2

Create a random guid in base64 RFC7515 format.

md­5(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.

sha25­6(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.

Temp­late li­teral (temp­lat­e st­rings­)

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.

text­Deco­d­e(bytes, encoding)

Converts a byte array to a string using the specified encoding.

tex­tEn­cod­e(text, encoding)

Converts a string into bytes using the specified encoding.

toHtm­l(text, text2, ...)

Converts multi line plain text to HTML.

en­code­Fil­ena­me(filename)

Encode a filename by replacing characters not allowed in filenames with their ASCII code representations. Reverse function of DecodeFilename.

de­code­Fil­ena­me(filename)

Decode an encoded filename string by replacing ASCII code representations with symbols (not allowed in filenames). Reverse function of EncodeFilename.

en­codeU­RI(text)

Encodes a URI by replacing certain characters by escape sequences representing the UTF-8 encoding of the characters.

en­codeU­RI­Com­ponen­t(text)

Encodes a URI by replacing certain characters by escape sequences representing the UTF-8 encoding of the characters.

htm­lAtt­ri­bu­teEn­cod­e(text)

The HtmlAttributeEncode method encodes characters appropriate for insertion into an HTML attribute value

htm­lEn­cod­e(text)

Converts a string into an HTML-encoded string.

re­moveEm­pty­Line­s(text)

Remove all empty lines (if any) from a string.

St­ring.­co­nca­t(string1, string2, ...)

Combines multiple strings into one string. Function may be called with one or a "whole bunch" of strings in as parameters.

St­ring­.in­clu­des(search)

The includes() method returns true if a string contains a specified string.

St­ring.­su­bst­rin­g(start, end)

The substring() method returns a part of the string between the start and end indexes, or to the end of the string.

St­ring­.in­d­exO­f(text)

Searches the entire calling string, and returns the index of the first occurrence of the specified substring.

St­ring.­la­stIn­dexO­f(text)

Searches for last occurence of a substring within a string.

St­ring.­re­pea­t(times)

Repeats a string a specified number times and returns the new value.

St­ring.­re­pla­ce(find, replace)

Replaces specified text in a specific string with another text.

St­ring.s­pli­t(seperator)

Splits a single string into an array of strings based on specified seperator.

St­ring­.en­ds­Wit­h(text)

Searches the end of the string, and returns a boolean that is True if the string ends with this text otherwise False.

St­ring.s­t­arts­Wit­h(text)

Searches the start of the string, and returns a boolean that is True if the string starts with this text otherwise False.

St­ring.t­r­im

Removes spaces before and after a text in a string.

st­rip­Tag­s(html)

Removes all tags from a string

ur­lEn­code(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.