diff options
Diffstat (limited to 'doc/classes/String.xml')
-rw-r--r-- | doc/classes/String.xml | 51 |
1 files changed, 48 insertions, 3 deletions
diff --git a/doc/classes/String.xml b/doc/classes/String.xml index ded64761d0..40fff25fc4 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -7,7 +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> + <link title="GDScript format strings">https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/gdscript_format_string.html</link> </tutorials> <methods> <method name="String"> @@ -654,6 +654,17 @@ Returns the string's amount of characters. </description> </method> + <method name="lpad"> + <return type="String"> + </return> + <argument index="0" name="min_length" type="int"> + </argument> + <argument index="1" name="character" type="String" default="" ""> + </argument> + <description> + Formats a string to be at least [code]min_length[/code] long by adding [code]character[/code]s to the left of the string. + </description> + </method> <method name="lstrip"> <return type="String"> </return> @@ -695,6 +706,15 @@ Returns the MD5 hash of the string as a string. </description> </method> + <method name="naturalnocasecmp_to"> + <return type="int"> + </return> + <argument index="0" name="to" type="String"> + </argument> + <description> + Performs a case-insensitive natural order comparison to another string. Returns [code]-1[/code] if less than, [code]+1[/code] if greater than, or [code]0[/code] if equal. + </description> + </method> <method name="nocasecmp_to"> <return type="int"> </return> @@ -816,6 +836,17 @@ Returns the right side of the string from a given position. </description> </method> + <method name="rpad"> + <return type="String"> + </return> + <argument index="0" name="min_length" type="int"> + </argument> + <argument index="1" name="character" type="String" default="" ""> + </argument> + <description> + Formats a string to be at least [code]min_length[/code] long by adding [code]character[/code]s to the right of the string. + </description> + </method> <method name="rsplit"> <return type="PackedStringArray"> </return> @@ -953,7 +984,7 @@ <return type="PackedByteArray"> </return> <description> - Converts the String (which is a character array) to [PackedByteArray] (which is an array of bytes). The conversion is faster compared to [method to_utf8], as this method assumes that all the characters in the String are ASCII characters. + Converts the String (which is a character array) to ASCII/Latin-1 encoded [PackedByteArray] (which is an array of bytes). The conversion is faster compared to [method to_utf8], as this method assumes that all the characters in the String are ASCII/Latin-1 characters, unsupported characters are replaced with spaces. </description> </method> <method name="to_float"> @@ -984,11 +1015,25 @@ Returns the string converted to uppercase. </description> </method> + <method name="to_utf16"> + <return type="PackedByteArray"> + </return> + <description> + Converts the String (which is an array of characters) to UTF-16 encoded [PackedByteArray] (which is an array of bytes). + </description> + </method> + <method name="to_utf32"> + <return type="PackedByteArray"> + </return> + <description> + Converts the String (which is an array of characters) to UTF-32 encoded [PackedByteArray] (which is an array of bytes). + </description> + </method> <method name="to_utf8"> <return type="PackedByteArray"> </return> <description> - Converts the String (which is an array of characters) to [PackedByteArray] (which is an array of bytes). The conversion is a bit slower than [method to_ascii], but supports all UTF-8 characters. Therefore, you should prefer this function over [method to_ascii]. + Converts the String (which is an array of characters) to UTF-8 encode [PackedByteArray] (which is an array of bytes). The conversion is a bit slower than [method to_ascii], but supports all UTF-8 characters. Therefore, you should prefer this function over [method to_ascii]. </description> </method> <method name="trim_prefix"> |