summaryrefslogtreecommitdiff
path: root/doc/classes/String.xml
diff options
context:
space:
mode:
authorRaul Santos <raulsntos@gmail.com>2021-10-22 01:57:34 +0200
committerGitHub <noreply@github.com>2021-10-22 01:57:34 +0200
commitbaa83012ef879305c40a36ca036ea9c30f4842a3 (patch)
tree65d1627d199fd04cbb10424468654ef101abb670 /doc/classes/String.xml
parentbbcf8ac672e4176dc7e52674b9c6a6e973aeb049 (diff)
Fix `bin_to_int` documentation examples
The `bin_to_int` method uses the `0b` prefix.
Diffstat (limited to 'doc/classes/String.xml')
-rw-r--r--doc/classes/String.xml4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/classes/String.xml b/doc/classes/String.xml
index 10ce03c4b2..abb68e0d05 100644
--- a/doc/classes/String.xml
+++ b/doc/classes/String.xml
@@ -56,11 +56,11 @@
Converts a string containing a binary number into an integer. Binary strings can either be prefixed with [code]0b[/code] or not, and they can also start with a [code]-[/code] before the optional prefix.
[codeblocks]
[gdscript]
- print("0x101".bin_to_int()) # Prints "5".
+ print("0b101".bin_to_int()) # Prints "5".
print("101".bin_to_int()) # Prints "5".
[/gdscript]
[csharp]
- GD.Print("0x101".BinToInt()); // Prints "5".
+ GD.Print("0b101".BinToInt()); // Prints "5".
GD.Print("101".BinToInt()); // Prints "5".
[/csharp]
[/codeblocks]