From 295b531e3d7483e9df2582ec313fe5121b0d9d0d Mon Sep 17 00:00:00 2001 From: Tom Date: Fri, 5 Aug 2022 22:16:43 +0100 Subject: [PATCH] updated the String class with info about the 'allow_empty' optional argument (cherry picked from commit 39233c299c63295bc476bd51c1a07c13cb577aae) --- doc/classes/String.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/classes/String.xml b/doc/classes/String.xml index 759577cc191..4a1ca48807e 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -696,6 +696,7 @@ 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: [codeblock] @@ -765,6 +766,7 @@ 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: @@ -785,6 +787,7 @@ 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.