String functions in Adobe Workfront Fusion
Access requirements
You must have the following access to use the functionality in this article:
For more detail about the information in this table, see Access requirements in Workfront documentation.
For information on Adobe Workfront Fusion licenses, see Adobe Workfront Fusion licenses.
length (text or buffer)
Returns the length of text string (number of characters) or binary buffer (buffer size in bytes).
length( hello )
lower (text)
Converts all alphabetical characters in a text string to lowercase.
lower( Hello )
capitalize (text)
Converts the first character in a text string to uppercase.
capitalize( workfront )
startcase (text)
Capitalizes the first letter of every word and lower cases all other letters.
startcase( hello WORLD )
ascii (text; [remove diacritics])
Removes all non-ascii characters from a text string.
-
ascii(
Wěošrčkřfžrýoáníté
)
Returns: Workfront
-
ascii(
ěščřž
;
true
)
Returns: escrz
replace (text;search string; replacement string)
Replaces the search string with the new string.
replace( Hello World ; Hello ; Hi )
Regular expressions (enclosed in /.../
) can be used as search string with a combination of flags (such as g
, i
, m
) appended:
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. This is 1-indexed.
+420777111222
+420777111222
/ is (?<number>\d+)/
in the replacement string argument. Doing so results in an error.For more information on regular expressions, see Text parser.
trim (text)
Removes space characters at the start or end of the text.
upper (text)
Converts all alphabetical characters in a text string to uppercase.
upper( Hello )
substring (text; start;end)
Returns a portion of a text string between the “start” position and “end” position.
-
substring( Hello ; 0 ; 3)
Returns: Hel
-
substring( Hello ; 1 ; 3 )
Returns: el
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 that is searched for is not there. The start value indicates where in the string the search should begin.
-
indexOf( Workfront ; o )
Returns: 1
-
indexOf( Workfront ; x )
Returns: -1
-
indexOf( Workfront ; o ; 3 )
Returns: 6
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( Workfront )
Returns: 57 6f 72 6b 66 72 6f 6e 74
-
toBinary( V29ya2Zyb250 ; base64 )
Returns: 57 6f 72 6b 66 72 6f 6e 74
toString (value)
Converts any value to a string.
encodeURL (text)
Encodes special characters in some text to a valid URL address.
decodeURL (text)
Decodes special characters in a URL to text.
decodeURL( Automate%20your%20workflow )
escapeHTML (text)
Escapes all HTML tags in text.
escapeHTML( <b>Hello</b> )
<b>Hello</b>
escapeMarkdown(text)
Escapes all Markdown tags in text.
escapeMarkdown( # Header )
# Header
stripHTML (text)
Removes all HTML tags from text.
stripHTML( <b>Hello</b> )
contains (text; search string)
Verifies whether text contains the search string.
-
contains( Hello World ; Hello )
Returns: true
-
contains( Hello World ; Bye )
Returns: false
split (text; separator)
Splits a string into an array of strings by separating the string into substrings.
split( John, George, Paul ; , )
md5 (text)
Calculates the md5 hash of a string.
md5( Workfront )
1448bbbeaa7a9b8091d426999f1f666b
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( workfront )
sha256 (text; [encoding]; [key])
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( workfront )
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”
- “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(workfront)
base64 (text)
Transforms text to base64.
base64( workfront )