user manual

145
CLEM Language Reference
Function
Result
Description
stripchar(CHAR,STRING)
String
Enables you to remove specied characters
from a string or eld. You can use this
function, for example, to remove extra
symbols, such as currency no t ati ons, from
data to achieve a simple number or name.
For example, using the syntax stripchar(`$`,
'Cost') returns a new eld with the dollar
sign removed from al l values.
Note: Be sure to use single backquot es to
encapsulate th e sp eci ed character.
skipchar(CHAR, N, STRING)
Integer
Searches t he st ring STRING for any
character other than CHAR, starting at the
Nth character. This function returns an
integer substring indicating the point at
which o ne is found or 0 if every character
from the Nth onward is a CHAR. If the
function has an invalid offset (for example,
an offset that is beyond the length of the
string), this function returns $null$.
locchar is often used in conjunction with the
skipchar functions to determi ne the val ue
of N (the point at which to start searching
the string). For examp l e, skipchar(`s`,
(locchar(`s`, 1, "MyString")), "MyString").
skipchar_back(CHAR, N, STRING)
Integer
Similar to skipchar, except that the search is
performed backward, starting from the Nt h
character.
startstring(LENGTH, STRING)
String
Extracts the rst N characters from the
specied string. If the string length is less
than or equal to the speci ed length, then it
is unchanged.
strmember(CHAR, STRING)
Integer
Equivalent to locchar(CHAR, 1, STRING). It
returns an integer substring indicating the
point at which CHAR rst occurs, or 0. I f the
function has an invalid offset (for example,
an offset that is beyond the length of the
string), this function returns $null$.
subscrs(N, STRING)
CHAR
Returns the Nth character CHAR of the input
string STRING. Thi s function can also be
written in a shorthand form as STRING(N).
For example, lowertoupper(“name”(1)) is a
valid expression.
substring(N, LEN, STRING)
String
Returns a string SUBSTRING, which consists
of the LEN characters of the st ring STRING,
starting from the character at subscript N.
substring_between(N1, N2, STRING)
String
Returns the substring of STRING, which
begins at subscript N1 and ends at subscript
N2.
trim(STRING)
String
Removes leading and trailing white space
characters from the specied string.
trim_start(STRING)
String
Remov
es leading white space characters
from the specied string.
trimend(STRING)
String
Removes trailing white space characters
from the specied string.