user manual

142
Chapter 8
In CLEM, a string is any sequence of characte r s between match ing double quotation marks
("string quot
es"). Characters (CHAR) can be any single alp hanumer ic character. They are declared
in CLEM expressions using single backquotes in the form of `<character>`, such as `z`, `A`, or `2`.
Charac ters that ar e out-of-bounds o r negative indices to a string will result in undened behavior.
Note. Compar
isons between strings th at do a nd do not use SQL pu shback may generate different
results where tra iling spaces exist.
Function
Result
Description
allbutfirst(N, STRING)
String
Returns a string, which is STRING with the
rst N characters removed.
allbutlast(N, STRING)
String
Returns a string, which is STRING with the
last characters removed.
alphabefore(STRING1, STRING2)
Boolean
Used to check the al phabetical ordering of
strings. Returns true if STRING1 precedes
STRING2.
endstring(LENGTH, STRING)
String
Extracts the last N characters from the
specied string. If the string length is less
than or equal to the speci ed length, then it
is unchanged.
hasendstring(STRING, SUBSTRING)
Integer
This function is the same as
isendstring(SUBSTRING, STRING).
hasmidstring(STRING, SUBSTRING)
Integer
This function is the same as
ismidstring(SUBSTRING, STRING)
(embedded substring).
hasstartstring(STRING, SUBSTRING)
Integer
This function is the same as
isstartstring(SUBSTRING, STRING).
hassubstring(STRING, N, SUBSTRING)
Integer
This func
tion is the same as
issubstring(SUBSTRING, N, STRING),
where N default s to 1.
count_substring(STRING, SUBSTRING)
Integer
Returns the number of times the specied
substring occurs within the string. For
example,
count_substring("foooo.txt", "oo") returns 3 .
hassubstring(STRING, SUBSTRING)
Integer
This function is the same as
issubstring(SUBSTRING, 1, STRING),
where N default s to 1.
isalphacode(CHAR)
Boolean
Returns a value of true if CHAR is a character
in the specied string (often a eld name)
whose charac t er code is a letter. Otherwise,
this function returns a value of 0. For
example, isalphacode(produce_num(1)).
isendstring(SUBSTRING, STRING)
Integer
If the stri ng STRING ends with the substring
SUBSTRING, then this function returns the
integer subscript of SUBSTRING in STRING.
Otherwise, this function returns a value of 0.
islowercode(CHAR)
Boolean
Returns a value of true if CHAR is a
lowercase l et t er character for the specied
string (often a eld name). Otherwise,
this function returns a value of 0. For
example, both islowercode(``) and
islowercode(country_name(2)) are valid
expressions.