144
Chapter 8
Function Result Description
locchar(CHAR,N , STRING) Integer
Used to identify the location of characters
in symbolic elds. The function searches
the string STRING for the character CHAR,
starting the search at the Nth character
of STRING. This function returns a value
indicating the location (starting at N) where
thech aracter is found. If the character is not
found, this function returns a value of 0. If
the function has an invalid offset (N) (for
example, an offset that is beyond the length
ofth e string), this function returns $null$.
For example, locchar(`n`, 2, web_page)
searchesthe eld call ed web_page for the `n`
character beginning at the second character
in the eld value.
Note: Be sure to use single backquotes to
encapsulate the specied character.
locchar_back(CHAR, N, STRING) Integer
Similar to locchar, except that the search is
performed backward starting from the Nth
character. For example, locchar_back(`n`,
9,web_ page) searches the eld web_page
startingf rom the ninth character and moving
backward toward the start of the string.
If the function has an invalid offset (for
example, an offset that is beyond the length
of the string), this function returns $null$.
Ideally,y ous hould use locchar_back in
conjunction with the function length(<field>)
to dynamically use the length of the
current value of the eld. For example,
locchar_back(`n`, (length(web_page)),
web_page).
lowertoupper(CHAR)
lowertoupper (STRING)
CHAR or
String
Input can be either a string or character,
which is used in this function to return
a new item of the same type, with any
lowercase characters converted to their
uppercase equivalents. F or example,
lowertoupper(`a`),lowertoupper(“My
string”), and lowertoupper(field_name(2))
are all valid expressions.
matches Boolean
Returns true if a string matches a specied
pattern. The pattern must be a string literal;
itcannot be a eld name contain ing a pattern.
A question mark (?) can be included in the
pattern to match exactly one character; an
asterisk (*) matches zero or more characters.
Tomatch a literal question mark o r asterisk
(rather than using these as wildcards), a
backslash (\) can be used as an escape
character.
replace(SUBSTRING, NEWSUBSTRING,
STRING) String
Within the specied STRING, replace
all instances of SUBSTRING with
NEWSUBSTRING.
replicate(COUNT,STRING) String Returns a string that consists of the original
stringco pied the specied number of times.