String functions perform various character manipulations. They operate on character strings.
Function | Example | Description |
---|---|---|
Ascii |
|
Converts a single character string to its corresponding ASCII code, between 0 and 255. If the character expression evaluates to multiple characters, the ASCII code corresponding to the first character in the expression is returned. |
Bit_Length |
|
Returns the length, in bits, of a specified string. Each Unicode character is 2 bytes in length (equal to 16 bits). |
Char |
|
Converts a numeric value between 0 and 255 to the character value corresponding to the ASCII code. |
Char_Length |
|
Returns the length, in number of characters, of a specified string. Leading and trailing blanks are not counted in the length of the string. |
Concat |
|
Concatenates two character strings. |
Insert |
|
Inserts a specified character string into a specified location in another character string. |
Left |
|
Returns a specified number of characters from the left of a string. |
Length |
|
Returns the length, in number of characters, of a specified string. The length is returned excluding any trailing blank characters. |
Locate |
|
Returns the numeric position of a character string in another character string. If the character string is not found in the string being searched, the function returns a value of 0. |
LocateN |
|
Like Locate, returns the numeric position of a character string in another character string. LocateN includes an integer argument that enables you to specify a starting position to begin the search. |
Lower |
|
Converts a character string to lowercase. |
Octet_Length |
|
Returns the number of bytes of a specified string. |
Position |
|
Returns the numeric position of |
Repeat |
|
Repeats a specified expression |
Replace |
|
Replaces one or more characters from a specified character expression with one or more other characters. |
Right |
|
Returns a specified number of characters from the right of a string. |
Space |
|
Inserts blank spaces. |
Substring |
|
Creates a new string starting from a fixed number of characters into the original string. |
SubstringN |
|
Like Substring, creates a new string starting from a fixed number of characters into the original string. SubstringN includes an integer argument that enables you to specify the length of the new string, in number of characters. |
TrimBoth |
|
Strips specified leading and trailing characters from a character string. |
TrimLeading |
|
Strips specified leading characters from a character string. |
TrimTrailing |
|
Strips specified trailing characters from a character string. |
Upper |
|
Converts a character string to uppercase. |