PARSE Function

Parses a string into words and returns the number of words found and the words found.

Category: String
Returned data type: Integer

Syntax

PARSE(string, delimiter, word1 <, word2 , …>)

Required Arguments

string

specifies a string with delimiters that is to be separated into words; this can be specified as fixed string, field name, or expression

  Note If string is NULL, the function returns a NULL value. If string is empty ("") a value of 1 is returned.

delimiter

specifies a character that delimits the words in a string; this can be specified as fixed string, field name, or expression

word1

specifies a string that represents the first word found; this is specified as field names

Optional Argument

word2, ...

specifies one or more strings that represents, in order, strings that are found after the first string; these are specified as field names

Details

The PARSE function assigns to the provided parameters the words found in string that are separated by a delimiter. The return values indicates the number of words found.

Comparison

The APARSE function is similar. The APARSE function is more flexible as you do not have to know in advance the maximum number of words. It can also be used to easily determine the last word in a string.

Example

string = "one:two:three"

delimiter = ":"

nwords = parse(string, delimiter, word1, word2) // outputs 3

// word1 will contain the value "one"

// word2 will contain the value "two"