Changes

Jump to navigation Jump to search
253 bytes removed ,  18:36, 1 December 2023
m
Text replacement - "<syntaxhighlight lang="xquery">" to "<pre lang='xquery'>"
{{Announce|Updated with Version 10:}} Renamed from ''Strings Module'' to ''String Module''. The namespace URI has been updated as well.
 
This [[Module Library|XQuery Module]] contains functions for string operations and computations.
* {{Code|string:levenshtein("flower", "lewes")}} returns {{Code|0.5}}
* In the following query, the input is first normalized (words are stemmed, converted to lower case, and diacritics are removed). It returns {{Code|1}}:
<syntaxhighlight pre lang="'xquery"'>
let $norm := ft:normalize(?, map { 'stemming': true() })
return string:levenshtein($norm("HOUSES"), $norm("house"))
</syntaxhighlightpre>
|}
=Formatting=
 
{{Announce|The functions in this section have been adopted from the obsolete Output Module.}}
==string:format==
| width='120' | '''Signature'''
|<pre>string:format(
$format pattern as xs:string, $inputs values... as item()...
) as xs:string</pre>
|- valign="top"
| '''Summary'''
|Returns a formatted string. The remaining {{Code|$inputvalues}} are inserted to incorported into the {{Code|$formatpattern}} string, according to [https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html#syntax Java’s printf syntax].
|- valign="top"
| '''Errors'''
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu