Skip to main content
Skip table of contents

String

A String is a text value, or a sequence of characters. It is the only value type that is displayed on a document as is - all other value types are first converted into Strings before ending up as part of document content.

Related commands

  • set
    Allows creation of new String variables within the logic using value expressions like Giraffe or ${'Giraffe'}, but not ${Giraffe}.

Methods

contains(string)

Resolves into Boolean true or false depending on whether the String contains the specified parameter String.

For example, an expression ${documentName.contains("Addendum")} would resolve into true if 'documentName' is "Price Addendum" or "Addendum 2".

length()

Resolves into a Number telling how many characters the String contains.

For example, an expression ${userDescription.length() > 200} would function as a condition resolving into true if 'userDescription' is longer than 200 characters.

 replace(target,replacement)

Resolves into a String that has all occurrences of the specified 'target' text replaced with 'replacement' text.

For example, if variable 'name' has value "Important template", expression ${name.replace('template','document')} would resolve into "Important document". The 'replacement' may also be set as an empty String to remove parts of the base String, so using the previous 'name' with expression ${name.replace('Important ','')} would result in "template".  

startsWith(string)

Resolves into Boolean true or false, depending on whether the String starts with the specified parameter String.

For example, an expression ${productType.startsWith('Cat')} would resolve into true if 'productType' is "Cat Robot", but into false if it is "Robot Cat" instead.

substring(beginIndex) / substring(beginIndex,endIndex)

Resolves into a String that is a portion of the base String. The portion starts from the character at index specified with 'beginIndex' (0 being the first character) and extends to the character at index specified with 'endIndex', or to the end of the String if 'endIndex' is not defined.

For example, if 'documentName' is "C288 Introduction Letter", expression ${documentName.substring(5)} would resolve into "Introduction Letter".

toLowerCase() / toUpperCase()

Resolves into a String that is the same String except with all the characters converted into lower or upper case.

For example, if 'favoriteColor' is "green" or "Green", expression ${favoriteColor.toLowerCase()} would resolve into "green" in both cases.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.