diff options
author | Tom <tommy.b89@hotmail.co.uk> | 2022-08-05 22:16:43 +0100 |
---|---|---|
committer | Tom <tommy.b89@hotmail.co.uk> | 2022-08-05 23:10:16 +0100 |
commit | 39233c299c63295bc476bd51c1a07c13cb577aae (patch) | |
tree | eb3737c793b74b4ace2ae258c19bb8a3a49b5000 /doc | |
parent | 15d1af11e2008512f4aaa32f731994b22b074636 (diff) |
updated the String class with info about the 'allow_empty' optional argument
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/String.xml | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/classes/String.xml b/doc/classes/String.xml index 9f197dae02..35ad5f03ab 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -640,6 +640,7 @@ <description> Splits the string by a [code]delimiter[/code] string and returns an array of the substrings, starting from right. The splits in the returned array are sorted in the same order as the original string, from left to right. + If [code]allow_empty[/code] is [code]true[/code], and there are two adjacent delimiters in the string, it will add an empty string to the array of substrings at this position. If [code]maxsplit[/code] is specified, it defines the number of splits to do from the right up to [code]maxsplit[/code]. The default value of 0 means that all items are split, thus giving the same result as [method split]. Example: [codeblocks] @@ -714,6 +715,7 @@ <argument index="2" name="maxsplit" type="int" default="0" /> <description> Splits the string by a [code]delimiter[/code] string and returns an array of the substrings. The [code]delimiter[/code] can be of any length. + If [code]allow_empty[/code] is [code]true[/code], and there are two adjacent delimiters in the string, it will add an empty string to the array of substrings at this position. If [code]maxsplit[/code] is specified, it defines the number of splits to do from the left up to [code]maxsplit[/code]. The default value of [code]0[/code] means that all items are split. If you need only one element from the array at a specific index, [method get_slice] is a more performant option. Example: @@ -742,6 +744,7 @@ <description> Splits the string in floats by using a delimiter string and returns an array of the substrings. For example, [code]"1,2.5,3"[/code] will return [code][1,2.5,3][/code] if split by [code]","[/code]. + If [code]allow_empty[/code] is [code]true[/code], and there are two adjacent delimiters in the string, it will add an empty string to the array of substrings at this position. </description> </method> <method name="strip_edges" qualifiers="const"> |