|
@@ -324,7 +324,6 @@
|
|
<description>
|
|
<description>
|
|
Splits the string using a [param delimiter] and returns the substring at index [param slice]. Returns the original string if [param delimiter] does not occur in the string. Returns an empty string if the [param slice] does not exist.
|
|
Splits the string using a [param delimiter] and returns the substring at index [param slice]. Returns the original string if [param delimiter] does not occur in the string. Returns an empty string if the [param slice] does not exist.
|
|
This is faster than [method split], if you only need one substring.
|
|
This is faster than [method split], if you only need one substring.
|
|
- [b]Example:[/b]
|
|
|
|
[codeblock]
|
|
[codeblock]
|
|
print("i/am/example/hi".get_slice("/", 2)) # Prints "example"
|
|
print("i/am/example/hi".get_slice("/", 2)) # Prints "example"
|
|
[/codeblock]
|
|
[/codeblock]
|
|
@@ -527,7 +526,6 @@
|
|
<param index="0" name="parts" type="PackedStringArray" />
|
|
<param index="0" name="parts" type="PackedStringArray" />
|
|
<description>
|
|
<description>
|
|
Returns the concatenation of [param parts]' elements, with each element separated by the string calling this method. This method is the opposite of [method split].
|
|
Returns the concatenation of [param parts]' elements, with each element separated by the string calling this method. This method is the opposite of [method split].
|
|
- [b]Example:[/b]
|
|
|
|
[codeblocks]
|
|
[codeblocks]
|
|
[gdscript]
|
|
[gdscript]
|
|
var fruits = ["Apple", "Orange", "Pear", "Kiwi"]
|
|
var fruits = ["Apple", "Orange", "Pear", "Kiwi"]
|
|
@@ -647,7 +645,6 @@
|
|
Converts a [float] to a string representation of a decimal number, with the number of decimal places specified in [param decimals].
|
|
Converts a [float] to a string representation of a decimal number, with the number of decimal places specified in [param decimals].
|
|
If [param decimals] is [code]-1[/code] as by default, the string representation may only have up to 14 significant digits, with digits before the decimal point having priority over digits after.
|
|
If [param decimals] is [code]-1[/code] as by default, the string representation may only have up to 14 significant digits, with digits before the decimal point having priority over digits after.
|
|
Trailing zeros are not included in the string. The last digit is rounded, not truncated.
|
|
Trailing zeros are not included in the string. The last digit is rounded, not truncated.
|
|
- [b]Example:[/b]
|
|
|
|
[codeblock]
|
|
[codeblock]
|
|
String.num(3.141593) # Returns "3.141593"
|
|
String.num(3.141593) # Returns "3.141593"
|
|
String.num(3.141593, 3) # Returns "3.142"
|
|
String.num(3.141593, 3) # Returns "3.142"
|
|
@@ -802,7 +799,6 @@
|
|
Splits the string using a [param delimiter] and returns an array of the substrings, starting from the end of the string. The splits in the returned array appear in the same order as the original string. If [param delimiter] is an empty string, each substring will be a single character.
|
|
Splits the string using a [param delimiter] and returns an array of the substrings, starting from the end of the string. The splits in the returned array appear in the same order as the original string. If [param delimiter] is an empty string, each substring will be a single character.
|
|
If [param allow_empty] is [code]false[/code], empty strings between adjacent delimiters are excluded from the array.
|
|
If [param allow_empty] is [code]false[/code], empty strings between adjacent delimiters are excluded from the array.
|
|
If [param maxsplit] is greater than [code]0[/code], the number of splits may not exceed [param maxsplit]. By default, the entire string is split, which is mostly identical to [method split].
|
|
If [param maxsplit] is greater than [code]0[/code], the number of splits may not exceed [param maxsplit]. By default, the entire string is split, which is mostly identical to [method split].
|
|
- [b]Example:[/b]
|
|
|
|
[codeblocks]
|
|
[codeblocks]
|
|
[gdscript]
|
|
[gdscript]
|
|
var some_string = "One,Two,Three,Four"
|
|
var some_string = "One,Two,Three,Four"
|
|
@@ -882,7 +878,6 @@
|
|
Splits the string using a [param delimiter] and returns an array of the substrings. If [param delimiter] is an empty string, each substring will be a single character. This method is the opposite of [method join].
|
|
Splits the string using a [param delimiter] and returns an array of the substrings. If [param delimiter] is an empty string, each substring will be a single character. This method is the opposite of [method join].
|
|
If [param allow_empty] is [code]false[/code], empty strings between adjacent delimiters are excluded from the array.
|
|
If [param allow_empty] is [code]false[/code], empty strings between adjacent delimiters are excluded from the array.
|
|
If [param maxsplit] is greater than [code]0[/code], the number of splits may not exceed [param maxsplit]. By default, the entire string is split.
|
|
If [param maxsplit] is greater than [code]0[/code], the number of splits may not exceed [param maxsplit]. By default, the entire string is split.
|
|
- [b]Example:[/b]
|
|
|
|
[codeblocks]
|
|
[codeblocks]
|
|
[gdscript]
|
|
[gdscript]
|
|
var some_array = "One,Two,Three,Four".split(",", true, 2)
|
|
var some_array = "One,Two,Three,Four".split(",", true, 2)
|