String Functions

The XPath editor context menu contains string functions used in expressions.

Table 1. String functions
Name Description
concat Returns the concatenation of its arguments.
contains Returns true if the first argument string contains the second argument string. Otherwise, returns false.
normalize-space Removes leading and trailing whitespace from a string and replaces internal sequences of whitespace with a single space character.
starts-with Returns true if the first argument string starts with the second argument string. Otherwise, returns false.
string Converts an object to a string.
string-length Returns the number of characters in a string value.
substring Returns the substring of the first argument starting at the position specified in the second argument with the length specified in the third argument. Example: substring('12345',2,3) returns '234'.
substring-to-end Returns the substring of the first argument starting at the position specified in the second argument and continues to the end of the string. Example: substring ('12345',2) returns '2345'.
substring-after Returns the substring of the first argument string that follows the first occurrence of the second argument string in the first argument string, or the empty string if the first argument string does not contain the second argument string. For example, substring-after('1999/04/01','/') returns 04/01, and substring-after('1999/04/01', 19) returns 99/04/01.
substring-before Returns the substring of the first argument string that precedes the first occurrence of the second argument string in the first argument string, or the empty string if the first argument string, or the empty string if the first argument string does not contain the second argument string. For example, substring-before('1999/04/01','/') returns 1999.
to lower case Converts the contents of a string to lower case.
to upper case Converts the contents of a string to upper case.
translate Returns the first argument string with occurrences of characters in the second argument string replaced by the character at the corresponding position in the third argument string.
Related concepts
XPath Editor

Send your feedback on this help topic to Sybase Technical Publications: pubs@sybase.com

Your comments will be sent to the technical publications staff at Sybase, Inc. For product-related issues or technical support, contact Sybase Technical Support at 1-800-8SYBASE.