Text rule functions

This topic describes the available text rule functions.

CAPIT

Returns the result of capitalizing the first letter of every word in a string and making the remaining characters lower case.

Syntax

CAPIT(String)

Where String is a string or a formula which returns a string.

Example

CAPIT('Alea iacta Est') returns "Alea Iacta Est"

Note: Strings used as arguments for rules functions must be enclosed in single quotes.

CHAR

Returns a string of one character which has an ASCII code of a specified number.

Syntax

CHAR(Value)

Where Value is an integer.

Example

CHAR(97) returns "a"

CHAR(49) returns "1"

CODE

Returns the ASCII code which corresponds to the character in a given position within a string.

Syntax

CODE(String,Location)

Where String is a string and location is the position within the string of the character in question. The first character of a string has location 1, the second, location 2 etc.

Location must be a positive integer.

Example

CODE('3121', 2) returns "49"

CODE('1', 1) returns "49"

CODE('iacta', 2) returns "97"

CODE('a', 1) returns "97"

Note: Strings used as arguments for rules functions must be enclosed in single quotes.

DELET

Returns a string obtained by deleting a specified number of characters from a string.

Syntax

DELET(String,StartLocation,N)

Where String is the string from which to delete characters, StartLocation is the location in the string from which to start deleting characters (1 being the first character in the string), and N is the number of characters to delete.

Examples

DELET('Alea', 2, 2) returns "AA"

DELET('IACTA', 1, 4) returns "A"

Note: Strings used as arguments for rules functions must be enclosed in single quotes.

FILL

Returns a string of a specified length that repeats a specified string.

Syntax

FILL(String, Length)

Where String is the string that will be repeated and Length is the length of the resulting string. The first argument must be a string or formula resulting in a string. The second argument must be a positive non-zero integer or formula resulting in a positive non-zero integer.

Examples

FILL('/', 5) returns "/////"

FILL('xy', 5) returns "xyxyx"

Note: Strings used as arguments for rules functions must be enclosed in single quotes.

INSRT

Returns a string obtained by inserting a string into another string, before an indicated position.

Syntax

INSRT(String1, String2, Location)

Where String1 is the string to be inserted, String2 is the string into which String1 will be inserted, and Location is the location in String 1 before which String 2 will be inserted.

Examples

INSRT('IACTA', 'ALEA EST', 5) returns "ALEA IACTA EST"

INSRT('ALEA ', 'IACTA EST', 1) returns "ALEA IACTA EST"

LONG

Returns the length of a string.

Syntax

LONG(String)

Where String is a string, or a formula which returns a string.

Example

Long('Alea') returns 4.

Note: Strings used as arguments for rules functions must be enclosed in single quotes.

LOWER

Displays the result of changing every upper case letter in a string to lower case.

Syntax

Lower(String)

Where String is a string, or a formula which returns a string.

Example

LOWER('Alea iacta Est') returns "alea iacta est"

NUMBR

Converts a string to its numerical value.

Syntax

NUMBR(String)

Where String is a string, or a formula which returns a string. All characters except '0' through '9', '+', '-','.' and 'E' are ignored. If String cannot be converted to a number, the result is undefined.

Examples

NUMBR('-7.8') returns "-7.8"

NUMBR('-6A.A6A') returns "-6.6")

NUMBR('-- 7') is undefined.

Note: Strings used as arguments for rules functions must be enclosed in single quotes.

SCAN

Returns a number which indicates the starting location of the first occurrence of a string within another string.

Syntax

SCAN(String1, String2)

Where String1 is the string to be searched for and String2 is the string in which the search occurs. Both arguments must be strings or formulas that return strings. If String1 does not occur in String2 then the function returns "0".

Example

SCAN('IACTA','Alea IACTA EST') returns "6"

Note: Strings used as arguments for rules functions must be enclosed in single quotes.

STR

Converts a number to a string.

Syntax

STR(Value, Length, Decimals)

Where Value is the value to be converted into a string, Length is the maximum length of the resulting string and Decimals is the number of decimal places that must be indicated by the string.

Example

STR(1.23456, 6, 2) returns " 1.23" (a six character string with two leading blanks)

SUBST

Returns a substring of a specified string with a specified length beginning at a specified character.

Syntax

SUBST(String, Beginning, Length)

Where String is the string from which you want to return the substring, Beginning is the number of the character in String that should be the first character of the substring, and Length is the length of the substring. The first argument must be a string or a formula that returns a string. The second two arguments must be integers. If non-integral values are entered in the second two arguments, they will be rounded to the nearest integer.

Example

SUBST('Alea IACTA EST', 6, 5) returns "IACTA"

TRIM

Trims tailing and leading blanks in a string.

Syntax

TRIM(String)

Where String is a string, or a formula which returns a string.

Example

TRIM(' Alea IACTA EST ') returns "Alea IACTA EST" .

Note: Strings used as arguments for rules functions must be enclosed in single quotes.

UPPER

Converts every lower case letter in a string to upper case.

Syntax

UPPER(String)

Example

UPPER('Alea IACTA est') returns "ALEA IACTA EST".

Note: Strings used as arguments for rules functions must be enclosed in single quotes.