Skip to main content

XQuery string-length Function

XQuery string-length Function

The string-length function is used to get the length of a string.

Syntax

string-length($string as xs:string) as xs:integer

Input Parameters

  • $string is the provided string.

Example

XQuery Expression
let $bookTitle := "Learn XQuery"
let $size := string-length($bookTitle)

return
<result>
<size>{$size}</size>
</result>
Output
<result>   
<size>12</size>
</result>