Loading TOC...

sql:left

sql:left(
   str as xs:anyAtomicType?,
   n as xs:double?
) as xs:string?

Summary

Returns a string that is the leftmost characters of the target string. The number of characters to return is specified by the second argument.

Parameters
str The base string. If the value is not a string, its string value will be used.
n The number of leftmost characters of the string to return.

Example

  sql:left("abcde",2)
  => "ab"

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.