diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-09-23 15:26:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-23 15:26:27 +0200 |
commit | 2114898cb5e8f3650602d3a949a00b766347dbfb (patch) | |
tree | 950dfc91cd39253702f6a76aea81085386ca1bbb /doc | |
parent | 159470df08c0283a2330af94d26ccbe3d009d8fd (diff) | |
parent | 757c509437720b50056bd67f8d4e463c38c5b13e (diff) |
Merge pull request #31172 from creikey/add-array-slicing
Add array slice method
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/Array.xml | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index 130908b842..45d40cccea 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -124,6 +124,21 @@ [b]Note:[/b] Calling [method bsearch] on an unsorted array results in unexpected behavior. </description> </method> + <method name="slice"> + <return type="Array"> + </return> + <argument index="0" name="begin" type="int"> + </argument> + <argument index="1" name="end" type="int"> + </argument> + <argument index="2" name="step" type="int" default="1"> + </argument> + <argument index="3" name="deep" type="bool" default="False"> + </argument> + <description> + Duplicates the subset described in the function and returns it in an array, deeply copying the array if [code]deep[/code] is true. Lower and upper index are inclusive, with the [code]step[/code] describing the change between indices while slicing. + </description> + </method> <method name="clear"> <description> Clears the array. This is equivalent to using [method resize] with a size of [code]0[/code]. |