Changes

Jump to navigation Jump to search
419 bytes removed ,  10:52, 21 November 2023
Reorder array:join and added some examples
</li>
</ul>
|}
 
 
==array:join==
 
{| width='100%'
| width='120' | '''Signature'''
|<pre>array:join(
$arrays as array(*)*
) as array(*)</pre>
|- valign="top"
| '''Summary'''
| Concatenates the contents of several {{Code|$arrays}} into a single array.
|- valign="top"
| '''Examples'''
|
* <code>array:join(())</code> returns the array {{Code|[]}}.
* <code>array:join((1 to 3) ! array { . })</code> returns the array {{Code|[1, 2, 3]}}.
* <code>array:join((["a", "b"], ["c", "d"]))</code> returns the array {{Code|["a", "b", "c", "d"]}}.
* <code>array:join((["a", "b"], ["c", "d"], [ ]))</code> returns the array {{Code|["a", "b", "c", "d"]}}.
* <code>array:join((["a", "b"], ["c", "d"], [["e", "f"]]))</code> returns the array {{Code|["a", "b", "c", "d", ["e", "f"]]}}.
|}
|
* <code>array:append(["a"], 1)</code> returns the array {{Code|[]}}.
|}
 
==array:insert-before==
 
{| width='100%'
| width='120' | '''Signature'''
|<pre>array:insert-before(
$array as array(*),
$position as xs:integer,
$member as item()*
) as array(*)</pre>
|- valign="top"
| '''Summary'''
| Returns a copy of {{Code|$array}} with one new {{Code|$member}} at the specified {{Code|$position}}. Setting {{Code|$position}} to the value {{Code|array:size($array) + 1}} yields the same result as {{Code|array:append($array, $insert)}}.
|- valign="top"
| '''Errors'''
|{{Error|FOAY0001|#Errors}} {{Code|$position}} is not in the range {{Code|1}} to {{Code|array:size($array) + 1}} inclusive.
|- valign="top"
| '''Examples'''
|
* <code>array:insert-before(["a"], 1, "b")</code> returns the array {{Code|["b", "a"]}}.
|}
|
* <code>array:reverse(array { 1 to 3 })</code> returns the array {{Code|[3, 2, 1]}}.
|}
 
==array:join==
 
{| width='100%'
| width='120' | '''Signature'''
|<pre>array:join(
$arrays as array(*)*
) as array(*)</pre>
|- valign="top"
| '''Summary'''
| Concatenates the contents of several {{Code|$arrays}} into a single array.
|- valign="top"
| '''Examples'''
|
* <code>array:join(())</code> returns the array {{Code|[]}}.
* <code>array:join((1 to 3) ! array { . })</code> returns the array {{Code|[1, 2, 3]}}.
|}
administrator, Bureaucrats, editor, reviewer, Administrators
57

edits

Navigation menu