Last updated: Oct 09, 2024
With CLEM, you can run operations to compare strings, create strings, or access characters.
In CLEM, a string is any sequence of characters between matching double
quotation marks (
). Characters ("string quotes"
) can be any
single alphanumeric character. They're declared in CLEM expressions using single back quotes in the
form of CHAR
, such as `<character>`
, `z`
, or
`A`
. Characters that are out-of-bounds or negative indices to a string will result
in undefined behavior.`2`
Note: Comparisons between strings that do and do not use SQL pushback may
generate different results where trailing spaces exist.
Function | Result | Description |
---|---|---|
|
String | Returns a string, which is with the first
characters removed. |
|
String | Returns a string, which is with the last characters removed. |
|
Boolean | Used to check the alphabetical ordering of strings. Returns true if
precedes . |
|
Integer | Returns the number of times the specified substring occurs within the string. For example,
returns . |
|
String | Extracts the last characters from the specified string. If the string
length is less than or equal to the specified length, then it is unchanged. |
|
Integer | This function is the same as . |
|
Integer | This function is the same as (embedded
substring). |
|
Integer | This function is the same as . |
|
Integer | This function is the same as , where
defaults to . |
|
Integer | This function is the same as , where
defaults to . |
|
Boolean | Returns a value of true if is a character in the specified string
(often a field name) whose character code is a letter. Otherwise, this function returns a value of
. For example, . |
|
Integer | If the string ends with the substring ,
then this function returns the integer subscript of in
. Otherwise, this function returns a value of . |
|
Boolean | Returns a value of if is a lowercase letter
character for the specified string (often a field name). Otherwise, this function returns a value of
. For example, both and
are valid expressions. |
|
Integer | If is a substring of but does not start on
the first character of or end on the last, then this function returns the
subscript at which the substring starts. Otherwise, this function returns a value of
. |
|
Boolean | Returns a value of true if for the specified string (often a field
name) is a character whose character code is a digit. Otherwise, this function returns a value of
. For example, . |
|
Integer | If the string starts with the substring ,
then this function returns the subscript . Otherwise, this function returns a
value of . |
|
Integer | Searches the string , starting from its
character, for a substring equal to the string . If found, this function
returns the integer subscript at which the matching substring begins. Otherwise, this function
returns a value of . If is not given, this function defaults to
. |
|
Integer | Searches the string . If found, this function returns the integer
subscript at which the matching substring begins. Otherwise, this function returns a value of
. |
|
Integer | Returns the index of the occurrence of within
the specified . If there are fewer than occurrences of
, is returned. |
|
Integer | This function is the same as , but the match is constrained to
start on and to end on . The
or constraints may be disabled by supplying a
value of false for either argument—for example, is the same as . |
|
Boolean | Returns a value of true if is an uppercase letter character. Otherwise,
this function returns a value of . For example, both
and are valid
expressions. |
|
String | Returns the last character of (which must be at
least one character long). |
|
Integer | Returns the length of the string (that is, the number of characters
in it). |
|
Integer | Used to identify the location of characters in symbolic fields. The function searches the
string for the character , starting the search at the
character of . This function returns a value indicating
the location (starting at ) where the character is found. If the character is not
found, this function returns a value of 0. If the function has an invalid offset
(for example, an offset that is beyond the length of the string), this function
returns . For example, searches the field called for the
character beginning at the second character in the field value. Be sure to use single back quotes to encapsulate the specified character. |
|
Integer | Similar to , except that the search is performed backward starting
from the character. For example, searches the field starting from 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
. Ideally, you should use in conjunction with
the function to dynamically use the length of the current
value of the field. For example, . |
|
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. For
example, , , and
are all valid expressions. |
|
Boolean | Returns if a string matches a specified pattern. The pattern must be a
string literal; it can't be a field name containing a pattern. You can include a question mark
( ) in the pattern to match exactly one character; an asterisk ( )
matches zero or more characters. To match a literal question mark or asterisk (rather than using
these as wildcards), use a backslash ( ) as an escape character. |
|
String | Within the specified , replace all instances of
with . |
|
String | Returns a string that consists of the original string copied the specified number of times. |
|
String | Enables you to remove specified characters from a string or field. You can use this function,
for example, to remove extra symbols, such as currency notations, from data to achieve a simple
number or name. For example, using the syntax returns a new
field with the dollar sign removed from all values. Be sure to use single back quotes to encapsulate the specified character. |
|
Integer | Searches the string for any character other than
, starting at the character. This function returns an
integer substring indicating the point at which one is found or if every
character from the onward is a . If the function has an
invalid offset (for example, an offset that is beyond the length of the string), this function
returns . is often used in conjunction
with the functions to determine the value of (the point
at which to start searching the string). For example, . |
|
Integer | Similar to , except that the search is performed backward, starting
from the character. |
|
String | Extracts the first characters from the specified string. If the string
length is less than or equal to the specified length, then it is unchanged. |
|
Integer | Equivalent to . It returns an integer substring
indicating the point at which first occurs, or . If the
function has an invalid offset (for example, an offset that is beyond the length of the string),
this function returns . |
|
CHAR | Returns the character of the input string
. This function can also be written in a shorthand form as
. For example, is a valid
expression. |
|
String | Returns a string , which consists of the
characters of the string , starting from the character at subscript N. |
|
String | Returns the substring of , which begins at subscript
and ends at subscript . |
|
String | returns the substring between the
and occurrence of . If
is , then it will return the substring from the beginning of
up to but not including . If is
the last occurrence of , then it will return the substring from the
occurrence of to the end of the string. |
|
String | Removes leading and trailing white space characters from the specified string. |
|
String | Removes leading white space characters from the specified string. |
|
String | Removes trailing white space characters from the specified string. |
|
CHAR | Input must be decimal, not hexadecimal values. Returns the character with Unicode value
. |
|
NUM | Returns the Unicode value of . |
|
CHAR or String | Input can be either a string or character and is used in this function to return a new item
of the same type with any uppercase characters converted to their lowercase equivalents.
Remember to specify strings with double quotes and characters with single back quotes. Simple field names should be specified without quotes. |