Finding the Length of a String

The length of a string can be determined using the string-length function. It accepts a single string and returns its length as an integer. Whitespace is significant, so leading and trailing whitespace characters are counted. Table 17-5 shows some examples.

Table 17-5. Examples of the string-length function

Example

Return value

string-length("query")

5

string-length(" query ")

9

string-length(normalize-space(" query "))

5

string-length("")

0

string-length(" ")

1

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.116.51