fn:string-length

Return length of string value.

Top of page

Related Syntax Constructs

The following construct(s) refer to this construct:


Syntax

fn:string-length(string? $string) => integer?

Description

This function returns the length of the value of $string as integer value. If the value of $string is the empty sequence, the empty sequence is returned.

Argument

$string

string value

Example

  • string-length("Donaudampfschiffahrtskapitänsabzeichen")
  • string-length(normalize-space("   "))

The first function call returns 38, the second zero, since the string value is a zero-length string after normalizing whitespace.