Skip to main content
CxScript Types - String
Updated over 4 years ago

A string is a series of letters and/or numbers. Give variable s a value of type string the following way:

<cx:let name="s" value="This is a text"> 

 ... $s contains the value 'This is a text' ...

</cx:let>

Key

Every string has the following keys available: 

Key                        Result              Remark
length                   number           length of the string (number of characters)
lines                      list                   list of lines in a string
words                    list                   list of words in a string
lowercaseString   string              all capitals are replaced by lower case characters
uppercaseString  string              all lower case characters are replaced by capitals htmlString            string               the text translated (limited) into HTML
rtfString                string               the text translated (limited) into RTF
numberValue      number            numeric value of the string
                                                      (nil in case the string is empty)
dateValue            date                 date value of the string
                                                      (international notation including time zone)
propertyList         list                    list value of a string containing a value with the                                                                    following format: "(element0, element1, element2, …)"
terms                    string               When value of string: acceptant, acceptant mortgage,                                                        mortgage acceptant, acceptant mortgages

                                                      Then the key 'terms' supplies the following: acceptant                                                        "acceptant mortgage" "mortgage acceptant"                                                                        "acceptant mortgages"

                                                       With 'terms' a string can be easily used as a search                                                             value in a search line.

 

Example 1

Print the last name of a candidate in upper case characters only:

<cx:write value="$activity.toEmployee.lastName.uppercaseString"/>

 

Example 2

Print the first line of the address of a contactperson:

<cx:write value="$activity.toContact.address.lines.@first"/>

 

Voorbeeld 3

Print a line from a text ( like notes or address )  :

<cx:write value="$activity.toUser.homeAddress.lines.@at.1"/>

Previous example shows how to print e 2nd line. To print the first line :

<cx:write value="$activity.toUser.homeAddress.lines.@at.0"/>

 

htmlString

Using this key you will get the text with the following translations:

  • Newlines are replaced by the following HTML label <BR>.

  • Lines that start of with 3 spaces and an asterisk * are replaced by a bullet list through the following HTML labels <LU> and <LI>.

rtfString

Using this key you will get the text with the following translations:

  • Newlines are replaced by the RTF code /par.

  • Lines that start of with 3 spaces and an asterisk * are replaced by a bullet list through the corresponding RTF codes.

Remarks

  • A string value is any combination of letters and numbers with one exception: the string can never begin with a dollar sign. If a string value starts of with a dollar sign it is interpreted as the name of a variable.
    Thus: 

<cx:write value="x"/>     writes the chracater x

<cx:write value="$x"/>    writes the value of the variable x

 

  • Double quotes mark the beginning and the end of a string value. Does the string value itself contain double quotes? Then place every of those value quotes inside single quotes, like:

<cx:write value="And he said: '"'I will go as well.'"'."/>

 

Did this answer your question?