substring

Retrieve a substring from a string

Syntax

substring(string_expr,startpos_num,length_num)

Arguments

string_expr A string expression from which to retrieve a substring.
startpos_num The character position at which the retrieval begins.  The position of the first character is 1, not 0.
length_num The length, in bytes, of the substring to retrieve.

Description

This scalar string function retrieves the substring of length length_num that begins at character position startpos_num of the specified expression.  The string parameter can be an ASCII string or a Unicode string.  If a Unicode string is specified, the function returns a Unicode string.