Description
The functx:line-count function counts the number of lines in a string, using the carriage return and newline characters to indicate the end of a line.
Arguments and Return Type| Name | Type | Description |
$arg |
xs:string? |
the string to test |
| return value |
xs:integer |
XQuery Function Declaration| See XSLT definition. | | XQuery Syntax for July 2004 - January 2007 (1.0): |
|---|
declare namespace functx = "http://www.functx.com";
declare function functx:line-count
( $arg as xs:string? ) as xs:integer {
count(functx:lines($arg))
} ; | | XQuery Syntax for May 2003: |
|---|
declare namespace functx = "http://www.functx.com"
define function line-count
( $arg as xs:string? ) as xs:integer {
fn:count(functx:lines($arg))
} |
Exampleslet $lines := | 'a
value
on
many
lines' | return |
| XQuery Example | Results |
|---|
functx:line-count('a value')
|
1
|
functx:line-count($lines)
|
5
|
Depends OnSee AlsoHistory |
|