Was this helpful?
_StringParseKeyword Function
The _StringParseKeyword procedure returns the value of the specified keyword in a specially formatted string. This string’s format is:
"keyword1=value1[;keyword2=value2]"
The equals sign (=) separates a keyword from its value. The semicolon must be used to separate the end of a value from the next keyword. There is no space allowed before or after the equal sign. Everything between the semicolon (or the beginning of the string) and the equal sign is treated as part of the keyword. The last value does not have to end with the semicolon. If a value has trailing white space, it will be trimmed. Leading and embedded white space is retained.
The search for the keyword is not case sensitive. Trailing white space on keyword is trimmed before the search begins. If the keyword is found, its value is returned. If either the string or the keyword argument is empty, an empty string is returned.
This function has the following syntax:
varchar(2000) = _StringParseKeyword(string = varchar(2000),
          keyword = varchar(32))
Arguments
Data Type
Description
string
Varchar(2000)
The string to be parsed
keyword
Varchar(32)
The keyword for which the value should be returned
Example—_StringParseKeyword function:
The following is an example of how to use the _StringParseKeyword procedure to find the value of a keyword:
str1 = 'Name=John Doe;
Address=101 California, USA';
value=_StringParseKeyword(string = str1,
           keyword = 'address');
This example returns the string “101 California, USA”.
Last modified date: 12/20/2023