diff options
Diffstat (limited to 'doc/classes/String.xml')
-rw-r--r-- | doc/classes/String.xml | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/doc/classes/String.xml b/doc/classes/String.xml index 526a9427dc..af7e5a395a 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -7,6 +7,7 @@ This is the built-in string class (and the one used by GDScript). It supports Unicode and provides all necessary means for string handling. Strings are reference counted and use a copy-on-write approach, so passing them around is cheap in resources. </description> <tutorials> + <link>https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/gdscript_format_string.html</link> </tutorials> <methods> <method name="String"> @@ -661,16 +662,17 @@ <method name="rsplit"> <return type="PoolStringArray"> </return> - <argument index="0" name="divisor" type="String"> + <argument index="0" name="delimiter" type="String"> </argument> <argument index="1" name="allow_empty" type="bool" default="True"> </argument> <argument index="2" name="maxsplit" type="int" default="0"> </argument> <description> - Splits the string by a [code]divisor[/code] string and returns an array of the substrings, starting from right. - [b]Example:[/b] [code]"One,Two,Three"[/code] will return [code]["One","Two","Three"][/code] if split by [code]","[/code]. - If [code]maxsplit[/code] is specified, then it is number of splits to do, default is 0 which splits all the items. + 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]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]. + [b]Example:[/b] [code]"One,Two,Three,Four"[/code] will return [code]["Three","Four"][/code] if split by [code]","[/code] with [code]maxsplit[/code] of 2. </description> </method> <method name="rstrip"> @@ -708,27 +710,27 @@ <method name="split"> <return type="PoolStringArray"> </return> - <argument index="0" name="divisor" type="String"> + <argument index="0" name="delimiter" type="String"> </argument> <argument index="1" name="allow_empty" type="bool" default="True"> </argument> <argument index="2" name="maxsplit" type="int" default="0"> </argument> <description> - Splits the string by a divisor string and returns an array of the substrings. - [b]Example:[/b] [code]"One,Two,Three"[/code] will return [code]["One","Two","Three"][/code] if split by [code]","[/code]. - If [code]maxsplit[/code] is given, at most maxsplit number of splits occur, and the remainder of the string is returned as the final element of the list (thus, the list will have at most maxsplit+1 elements) + 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. + [b]Example:[/b] [code]"One,Two,Three"[/code] will return [code]["One","Two"][/code] if split by [code]","[/code] with [code]maxsplit[/code] of 2. </description> </method> <method name="split_floats"> <return type="PoolRealArray"> </return> - <argument index="0" name="divisor" type="String"> + <argument index="0" name="delimiter" type="String"> </argument> <argument index="1" name="allow_empty" type="bool" default="True"> </argument> <description> - Splits the string in floats by using a divisor string and returns an array of the substrings. + Splits the string in floats by using a delimiter string and returns an array of the substrings. [b]Example:[/b] [code]"1,2.5,3"[/code] will return [code][1,2.5,3][/code] if split by [code]","[/code]. </description> </method> @@ -740,7 +742,14 @@ <argument index="1" name="right" type="bool" default="True"> </argument> <description> - Returns a copy of the string stripped of any non-printable character at the beginning and the end. The optional arguments are used to toggle stripping on the left and right edges respectively. + Returns a copy of the string stripped of any non-printable character (including tabulations, spaces and line breaks) at the beginning and the end. The optional arguments are used to toggle stripping on the left and right edges respectively. + </description> + </method> + <method name="strip_escapes"> + <return type="String"> + </return> + <description> + Returns a copy of the string stripped of any escape character. These include all non-printable control characters of the first page of the ASCII table (< 32), such as tabulation ([code]\t[/code] in C) and newline ([code]\n[/code] and [code]\r[/code]) characters, but not spaces. </description> </method> <method name="substr"> |