The 32 text methods listed here are in their basic format that provide a simple text or numeric output based on text inputs. (The input may also include integer values for positioning within the text.)

Several text methods can be combined into one complex formula you’re looking for certain

kind of output. An example is:


[text1].Insert([text1].IndexOfAny([text2].ToCharArray()),[text3])


This formula searches through text1 for the first position of any character of text2 and inserts text3 at that position.


One of the more useful text formulas is the Format method. For example, it can be used to create a summary statement for customers:


Format("The customer: {0}, purchased the product: {1}, on {2}. The

shipping address is {3}”,[name],[product],[date],[address])


This method will replace all { } items with the corresponding text objects listed. See Formulas: Format Method section below for more details about this method.


The following text methods are grouped according to category:


Calculation Methods – Derives string parameters.


Method

Example

Description

Length

[text1].Length

Returns the number of characters in the current string instance.


Concatenation Methods – Appends two or more strings


Method

Example

Description

+

[text1] + [text2]

Concatenates text with a "+".

Concat

Concat([text1],[text2])

Appends one text string to another


Compare Methods – Compares the alphabetical position two strings or substrings, and returns either -1, 0, or 1 based on the sort order. For Example, if the first string is before the second string alphabetically, -1 is returned. The Equals method returns either “True” or “False”.


Method

Example

Description

Equals

[text1].Equals([text2])

Returns "true" if the string instance has the same value as a second string.

Compare

Compare([text1],[text2])

Compares the strings and returns their relative position in the sort order.

Compare while ignoring caseCompare([text1],[text2],true)Compares the strings and returns their relative position in the sort order while ignoring case.
CompareTo[text1].CompareTo([text2])Compares the current string instance with the specified string and returns their relative position in the sort order.
Compare(advanced)Compare([text1],3,[text2],7,4,true)Compares the substrings and returns their relative position in the sort order. The starting point of the comparison is given by the first two integers, while the third integer indicates the number of characters to compare. The last option of "true" ignores case.

 

Contains Methods - Tests if a substring is contained with the string instance under various conditions and returns either “True” or “False”.


Method

Example

Description

Contains

[text1].Contains([text2])

Returns "True" if the specified substring occurs within the string instance.

EndsWith

[text1].EndsWith([text2])

Returns "True" if the end of the string instance matches the specified string.

StartsWith

[text1].StartsWith([text2])

Returns "True" if the start of the string instance matches the specified string.


Modify MethodsThe first two methods specify a substring within a string instance and returns a string with the substring deleted (Remove), or a string with all characters deleted except for the substring (SubString). Insert returns a string in which the specified string is inserted at a specified position.


Method

Example

Description

Remove

[text1].Remove(3,5)

Returns a string in which a specified number of characters in the current instance beginning at a specified position have been deleted. If the second number isn't specified, characters will be deleted up to the end of the string.

SubString

[text1].SubString(3,5)

Returns a substring from the string instance. The substring starts at a specified character position and has a specified length. If length is omitted, the substring continues to the end of the string.

Insert

[text1].Insert(5,[text2]

Returns a string in which the specified string is inserted at a specified position in the string instance.


Format MethodsConverts a string to another format, such as uppercase or lowercase. The Format method can replace specified items within a string or paragraph with numerical or text data.


Method

Example

Description

ToUpper

[text1].ToUpper()

Returns a copy of the string converted to uppercase.

ToLower

[text1].ToLower()

Returns a copy of the string converted to lowercase.

Format

Format("The outside temperature is {0:N1} F or

{1:N2} C",[num1],[num2])

Replaces the formatted items in a string with the string representations of the listed objects. 

In this example the output would be:"The outside temperature is

47.3 F or 8.52 C"

ToCharArray

[text1].ToCharArray(3.5)

Returns an array of characters from the specified instance. Optional parameters indicate starting position and length. (Note: this method only works when nested within other methods, such as “Trim” or “IndexOfAny”.)


Trim MethodsReturns a string with the specified characters trimmed off the beginning, end, or both.


Method

Example

Description

Trim

[text1].Trim()

Removes all leading and trailing white- space characters from the string instance.

Trim

[text1].Trim([text2]. ToCharArray())

Removes all leading and trailing occurrences of a set of characters specified in an array from the string instance.

TrimStart

[text1].TrimStart([text2]. ToCharArray())

Removes all leading occurrences of a set of characters specified in an array from the string instance.

TrimEnd

[text1].TrimEnd([text2]. ToCharArray())

Removes all trailing occurrences of a set of characters specified in an array from the string instance.


Index MethodsReturns the position of a string or character in a string or substring depending on specified criteria. The IndexOfAny method will return the first position of any character in a specified character array in a string or substring.


Method

Example

Description

IndexOf

[text1].IndexOf("-")

Returns the position of the first occurrence of the specified character in the string instance.

IndexOf

[text1].IndexOf("-",5,8)

Returns the position of the specified character in the string instance. The search starts at the specified character position and continues up to the specified number of character positions. If this number isn't specified, the search will continue to the end of the string.

IndexOf[text1].IndexOf([text2])Returns the position of the first occurrence of the specified string in the string instance
IndexOf[text1].IndexOf([text2],5,8)Returns the position of the specified string in the string instance. The search starts at the specified character position and continues up to the specified number of character positions. If this number isn't specified, the search will continue to the end of the string.
LastIndexOf[text1].LastIndexOf("-")Returns the position of the last occurrence of the specified character in the string instance.
LastIndexOf[text1].LastIndexOf("-",5,8)Returns the position of the specified character in the string instance. The search starts at the specified character position and continues backwards up to the specified number of character positions. If this number isn't specified, the search will continue to the beginning of the string.
LastIndexOf[text1].LastIndexOf([text2])Returns the index position of the last occurrence of a specified string within this instance.
LastIndexOf[text1].LastIndexOf([text2],5,8)Returns the index position of the specified string in the string instance. The search starts at the specified character position and proceeds backward up to the specified number of character positions. If this number isn't specified, the search continues to the beginning of the string.
IndexOfAny[text1].IndexOfAny([text2]. ToCharArray())Returns the position of the first occurrence in the instance of any character in a specified array.
IndexOfAny[text1].IndexOfAny([text2]. ToCharArray(),1,5)Returns the position of the first occurrence in the instance of any character in a specified array. The search starts at a specified character position and examines a specified number of character positions. If this number isn't specified, the search continues to the end of the string.