Merge pull request #54109 from raulsntos/patch-1

This commit is contained in:
Rémi Verschelde 2021-10-22 12:28:10 +02:00 committed by GitHub
commit b4562106bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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. 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] [codeblocks]
[gdscript] [gdscript]
print("0x101".bin_to_int()) # Prints "5". print("0b101".bin_to_int()) # Prints "5".
print("101".bin_to_int()) # Prints "5". print("101".bin_to_int()) # Prints "5".
[/gdscript] [/gdscript]
[csharp] [csharp]
GD.Print("0x101".BinToInt()); // Prints "5". GD.Print("0b101".BinToInt()); // Prints "5".
GD.Print("101".BinToInt()); // Prints "5". GD.Print("101".BinToInt()); // Prints "5".
[/csharp] [/csharp]
[/codeblocks] [/codeblocks]