142
Chapter 8
In CLEM, a string is any sequence of characters between matching double quotation ma rks("string quotes"). Characters (CHAR) can be any single alphanum eric character. They are declaredin CLEM expressions using single backquotes in the form of `<character>`, such as `z`,`A`, or `2`.Characters that are out-of-bounds or negative indices to a string will result in undened behavior.Note. Comparisons between strings that do and do not use SQL pushback may generate differentresults where trailing spaces exist.
Function Result Description
allbutfirst(N, STRING) String Returns a string, which is STRING with the
rst Ncharacters removed.
allbutlast(N, STRING) String Returns a string, which is STRING with the
last characters removed.
alphabefore(STRING1, STRING2) Boolean
Used to check the alphabetical ordering of
strings. Returns true if STRING1 precedes
STRING2.
endstring(LENGTH, STRING) String
Extracts the last Ncharacters from the
specied string. If the string length is less
than or equal to the specied length, then it
is unchanged.
hasendstring(STRING, SUBSTRING) Integer This function is the same as
isendstring(SUBSTRING, STRING).
hasmidstring(STRING,SU BSTRING) 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 function is the same as
issubstring(SUBSTRING, N, STRING),
where Ndefaults 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,SU BSTRING) Integer
This function is the same as
issubstring(SUBSTRING, 1, STRING),
where Ndefaults to 1.
isalphacode(CHAR) Boolean
Returnsa value of true if CHAR is a character
in the specied string (often a eld name)
whose character code is a letter. Otherwise,
this function returns a value of 0. For
example, isalphacode(produce_num(1)).
isendstring(SUBSTRING, STRING) Integer
Ifthe string S TRING ends with the substring
SUBSTRING, then this function returns the
integersubscript of SU BSTRING in STRING.
Otherwise, this function returns a value of 0.
islowercode(CHAR) Boolean
Returns a value of true if CHAR is a
lowercase letter 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.