mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Document how to perform advanced string splitting using RegEx
This closes https://github.com/godotengine/godot-docs/issues/3607.
(cherry picked from commit 5f2b6bd476)
This commit is contained in:
committed by
Rémi Verschelde
parent
bd76fcd43b
commit
4a0568b609
@@ -817,8 +817,8 @@
|
||||
<argument index="2" name="maxsplit" type="int" default="0">
|
||||
</argument>
|
||||
<description>
|
||||
Splits the string by a [code]delimiter[/code] string and returns an array of the substrings.
|
||||
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 0 means that all items are split.
|
||||
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]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.
|
||||
Example:
|
||||
[codeblock]
|
||||
var some_string = "One,Two,Three,Four"
|
||||
@@ -827,6 +827,7 @@
|
||||
print(some_array[0]) # Prints "One"
|
||||
print(some_array[1]) # Prints "Two,Three,Four"
|
||||
[/codeblock]
|
||||
If you need to split strings with more complex rules, use the [RegEx] class instead.
|
||||
</description>
|
||||
</method>
|
||||
<method name="split_floats">
|
||||
|
||||
Reference in New Issue
Block a user