Attention: Here be dragons
This is the
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
A built-in type for strings.
This is the built-in string Variant type (and the one used by GDScript). Strings may contain any number of Unicode characters, and expose methods useful for manipulating and generating strings. Strings are reference-counted and use a copy-on-write approach (every modification to a string returns a new String), so passing them around is cheap in resources.
Some string methods have corresponding variations. Variations suffixed with
n (countn, findn, replacen, etc.) are case-insensitive (they make no distinction between uppercase and lowercase letters). Method variations prefixed with
r (rfind, rsplit, etc.) are reversed, and start from the end of the string, instead of the beginning.
Note: In a boolean context, a string will evaluate to
false if it is empty (
""). Otherwise, a string will always evaluate to
not operator cannot be used. Instead, is_empty should be used to check for empty strings.
There are notable differences when using this API with C#. See Différences de l'API C# par rapport à GDScript for more information.
String ( )
bigrams ( ) const
bin_to_int ( ) const
c_escape ( ) const
c_unescape ( ) const
capitalize ( ) const