IBM 15 Switch 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 notations, from
data to achieve a s i mple number or name.
For example, using the syntax stripchar(`$`,
'Cost') returns a new eld with the dollar
sign remove d from all values.
Note: Be sure to u se single backquotes to
encapsulate the specied character.
skipchar(CHAR, N, STRING)
Integer
Searches t he st ring STRING for any
character other than CHAR, starting at the
Nth character. T his function returns an
integer substring indicating the point at
which one is found or 0 if every character
from the Nth on w ard is a CHAR. If the
function has a n invalid offset (for example,
an offset that is beyond the len gth of the
string), this functio n returns $null$.
locchar is often used in conjunction with the
skipchar functions to determine the value
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 Nth
character.
startstring(LENGTH, STRING)
String
Extracts the rst N characters from the
specied st ring. If the string length is less
than or equal to th e specied 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. If the
function has a n invalid offset (for example,
an offset that is beyond the len gth of the
string), this functio n returns $null$.
subscrs(N, STRING)
CHAR
Returns the Nth character CHAR of the input
string STRING. This 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 string STRING,
starting from the character at subscript N.
substring_between(N1, N2, STRING)
String
Returns the substring of STRING, which
begins at subscript N1 an d 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 w hite space characters
from the specied string.