Home > System Defined Functions Reference > String Functions

String Functions

In addition to the operators used with strings, several functions are available for manipulating strings in expressions. All functions except Find, FindNoCase, Compare, CompareNoCase, and GetLength return a string result.

All String functions are multi-byte aware; in all cases, Count refers to a character count, and Index refers to a character index. User-defined functions do not accept string arguments. For more information, see Functions.

Function

Description

Syntax

Compare

Performs a case-sensitive comparison of String1 to String2. Results are -1 if String1 is less than, 0 if equal to, or 1 if greater than String2.

Compare(String1, String2)

CompareNoCase

Performs a case-insensitive comparison of String1 to String2. Results are -1 if less than, 0 if equal to, or 1 if greater than.

CompareNoCase(String1, String2)

CropLeft

Searches string left to right for CropString, which must consist of a single character. If found, returns String with the characters up to and including that character deleted. If not found, returns String.

CropLeft(String,CropString)

CropRight

Searches string right to left for CropString, which must consist of a single character. If found, returns String with the characters from that character to the end of String deleted. If not found, returns String.

CropRight(String,CropString)

Delete

Deletes at most Count characters from String starting at Index.

Delete(String, Index[, Count = 1])

DelimitedFind

Performs a case-sensitive delimited search of SearchString in String starting at Index and returns the index as a numeric result. Returns -1 if no string is found. To find SearchString, both of the following conditions must be met:

  1. Either SearchString must be located at the start of String, or the first character of SearchString or the character before SearchString must appear in DelimiterString; and

  2. SearchString must be located at the end of String, or the last character of SearchString or the character after SearchString must appear in DelimiterString.

DelimitedFind(String,SearchString,DelimiterString,[Index=0])

Find

Performs a case-sensitive search of SearchString in String starting at Index and returns the index as a numeric result. If no string is found, the result is -1.

Find(String, SearchString[, Index = 0])

FindNoCase

Performs a case-insensitive search of SearchString in String starting at Index and returns the index as a numeric result. Returns -1 if no string is found.

FindNoCase(String, SearchString[, Index = 0])

FindOneOf

Performs a case-sensitive search of String for the first character that is also in FindString. Returns -1 if no character is found.

FindOneOf(String,FindString)

GetLength

Obtains the length of String.

GetLength(String)

Insert

Inserts InsertionString at Index into String.

Insert(String, Index, InsertionString)

Left

If the second parameter is a number (Count), extracts the leftmost Count characters from String and returns the string result. If Count exceeds the string length, extracts the entire string.

If the second parameter is a string (IndexString), extracts the characters to the left of the first occurrence of IndexString. Returns String if String does not contain IndexString.

Left(String,Count/IndexString)

MakeLower

Converts String to lowercase.

MakeLower(String)

MakeReverse

Reverses the order of the characters of String.

MakeReverse(String)

MakeUpper

Converts String to uppercase.

MakeUpper(String)

Mid

If the second parameter is a number (Index), extracts at most Count characters from String starting at Index if Count is specified. If Count exceeds the string length, the entire string is extracted.

If the second parameter is a string (IndexString), extracts at most Count characters from String starting at the first occurrence of IndexString if Count is specified. If Count exceeds the string length, the entire string is extracted. If String does not contain IndexString, the null string is returned.

Mid(String,Index/IndexString,[Count])

Replace

Performs a case-sensitive search and replaces all occurrences of OldString with NewString.

Replace(String, OldString, NewString)

ReplaceNoCase

Performs a case-insensitive search and replaces all occurrences of OldString with NewString.

ReplaceNoCase(String, OldString, NewString)

ReverseFind

Searches string right to left for SearchString, which must consist of a single character. If found, the index of the character is returned. If not found, -1 is returned.

ReverseFind(String,SearchString)

Right

If the second parameter is a number (Count), extracts the rightmost Count characters from String and returns the string result. If Count exceeds the string length, extracts the entire string.

If the second parameter is a string (IndexString), extracts the characters to the right of the first occurrence of IndexString. If String does not contain IndexString, the null string is returned.

Right(String,Count/IndexString)

SetAt

Replaces the characters of String with SetString starting at Index. The end result can be longer than String.

SetAt(String, Index, SetString)

SpanExcluding

Extracts a string that contains characters in String that are not in SpanString, beginning with the first character in String and ending with the first character found in String that is also in SpanString. (That is, starting with the first character in String and up to but excluding the first character in String that is found in SpanString.) String is returned if no character in SpanString is found.

SpanExcluding(String,SpanString)

SpanIncluding

Extracts a string that contains the characters in String that are in SpanString, starting with the first character in String and ending when a character is found in String that is not in SpanString. Returns the null string if the first character in String is not in SpanString.

SpanIncluding(String,SpanString)

ToNumber

Converts a string to a number. Leading and trailing spaces are ignored. A null string is converted to zero. If Value is a number it is returned unchanged.

ToNumber(Value)

ToString

Converts the value of an attribute to a string based on the type of the attribute. If the Type of AttributeName is Value or String, then using ToString is the same as using ValueToString. Otherwise, for example, if the AttributeName is of type TrueFalse, is named x, and x = 3, then ToString(x) returns "True + 2".

ToString(AttributeName)

TrimLeft

If TrimString is omitted, returns String with the leading spaces removed. If TrimString is specified, returns String with the leading characters found in TrimString removed.

TrimLeft(String.[TrimString])

TrimRight

If TrimString is omitted, returns String with the trailing spaces removed. If TrimString is specified, returns String with the trailing characters found in TrimString removed.

TrimRight(String.[TrimString])

ValueToString

Converts a value to a string. For example, if the Value is an attribute of type TrueFalse, is named x, and x = 3, then ValueToString(x) returns "3". If Value is a string it is returned unchanged.

ValueToString(Value)

The following functions are useful for testing the types of expressions and obtaining the ID numbers and paths for activities, processes, and swimlanes:

Related Topics

System Defined Functions Reference