Explore more
Functions

String functions

31min
string functions let you modify and transform string data, also known as text use a string function to, for example, change capitalization, remove diacritics and accent marks, combine, split, encode, or decode text below is a list of supported string functions and a description of each ascii ascii (text; \[remove diacritics]) removes all non ascii characters from a text string ascii( ěmščařžkýáeíé) \= make ascii( ěščřž ; true ) \= escrz base64 base64 (text) transforms text to base64 base64( make ) \=twfrzq== combine the tobinary() and tostring() functions to transform base64 encoded text to plain text, as seen below tostring( tobinary( twfrzq== ; base64 ) ) \= make capitalize capitalize (text) converts the first character in a text string to uppercase capitalize(make) \= make contains contains (text; search string) verifies if text contains the search string contains( hello world ; hello ) \= true contains( hello world ; bye ) \= false decodeurl decodeurl (text) decodes special characters in url to text decodeurl( automate%20your%20workflow ) \= automate your workflow encodeurl encodeurl (text) encodes special characters in a text to a valid url address escapehtml escapehtml (text) escapes all html tags in text escapehtml( \<b>hello\</b> ) \= \&lt;b\&gt;hello\&lt;/b\&gt; indexof indexof (string; value; \[start]) returns the position of the first occurrence of a specified value in a string this method returns ' 1' if the value searched for never occurs indexof(make; k ) \= 2 indexof(we love make ; x ) \= 1 indexof(we love make ; e ; 7 ) \= 11 length length (text or buffer) returns the length of text string (number of characters) or binary buffer (buffer size in bytes) length( hello ) \= 5 lower lower (text) converts all alphabetical characters in a text string to lowercase lower( hello ) \= hello md5 md5 (text) calculates the md5 hash of a string md5(make) \= 529a05ca6c1263aab080ec4f20754411 replace (text; search string; replacement string) replaces the search string with the new string replace( hello world ; hello ; hi ) \= hi world regular expressions (enclosed in / / ) can be used as search string with a combination of flags (like g , i , m ) appended replace ( all these numbers 187 23 1 9565 will be replaced with x ; /\d+g ; x ) \= all these numbers x x x x will be replaced with x the replacement string can include the following special replacement patterns $& = inserts the matched substring $n = where n is a positive integer less than 100, inserts the nth parenthesized submatch string note that this is 1 indexed replace ( phone number is 777111222 ; /\d+g ; $& ) phone number is +420777111222 replace ( phone number is 777111222 ; / is (d) ; +42$1 ) phone number is +420777111222 do not use named capture groups like / is (?\<number>\d+)/ in the replacement string argument as this will throw an error replaceemojicharacters replaceemojicharacters (text) replaces emoji characters with the new string sha1 sha1 (text; \[encoding]; \[key]) calculates the sha1 hash of a string if the key argument is specified, sha1 hmac hash is returned instead supported encodings hex (default), base64 or latin1 sha1(make) \= a94431ee22f05f141107f9355ed3127d0f0c4d5a sha256 sha256 (text; \[encoding]; \[key]; \[key encoding]) calculates the sha256 hash of a string if the key argument is specified, sha256 hmac hash is returned instead supported encodings hex (default), base64 or latin1 sha256(make) \= ccdd25d4230fb997a7ee1166f8afabd157248eb812ea55ec7c3d1b7c8af7fa11 sha512 sha512 (text; \[output encoding]; \[key]; \[key encoding]) calculates the sha512 hash of a string if the key argument is specified, sha512 hmac hash is returned instead supported encodings hex (default), base64 or latin1 supported key encodings text (default), hex , base64 or binary when using binary key encoding, a key must be a buffer, not a string sha512(make) \= e8000cd0fb8fae18caa8daa677269b0034380d3ec549e0113a0722d8b8dc05b0f7037f33f32fa09f906b2f1d7c43f2689a55d79aadf6bf09dd93f79407424d34 split split (text; separator) splits a string into an array of strings by separating the string into substrings split( john, george, paul ; , ) startcase startcase (text) capitalizes the first letter of every word and lower cases all other letters startcase( hello world ) \= hello world striphtml striphtml (text) removes all html tags from text striphtml( \<b>hello\</b> ) \= hello substring substring (text; start; end) returns a portion of a text string between the "start" position and "the end" position substring( hello ; 0 ; 3 ) \= hel substring( hello ; 1 ; 3 ) \= el tobinary tobinary (value) converts any value to binary data you can also specify encoding as a second argument to apply binary conversions from hex or base64 to binary data tobinary(make) \= 4d 61 6b 65 tostring tostring (value) converts any value to a string tostring(tobinary(twfrzq==;base64) \= make trim trim (text) removes space characters at the start or end of the text upper upper (text) converts all alphabetical characters in a text string to uppercase upper( hello ) \= hello