Skip to content

Commit ed13d79

Browse files
committed
Merge pull request #104378 from DarkiStar/master
Documentation: Fix `hex_decode()` example in `String` and `StringName`
2 parents c67b9a4 + c774075 commit ed13d79

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

doc/classes/String.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,12 +367,12 @@
367367
[gdscript]
368368
var text = "hello world"
369369
var encoded = text.to_utf8_buffer().hex_encode() # outputs "68656c6c6f20776f726c64"
370-
print(buf.hex_decode().get_string_from_utf8())
370+
print(encoded.hex_decode().get_string_from_utf8())
371371
[/gdscript]
372372
[csharp]
373373
var text = "hello world";
374374
var encoded = text.ToUtf8Buffer().HexEncode(); // outputs "68656c6c6f20776f726c64"
375-
GD.Print(buf.HexDecode().GetStringFromUtf8());
375+
GD.Print(encoded.HexDecode().GetStringFromUtf8());
376376
[/csharp]
377377
[/codeblocks]
378378
</description>

doc/classes/StringName.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,12 +350,12 @@
350350
[gdscript]
351351
var text = "hello world"
352352
var encoded = text.to_utf8_buffer().hex_encode() # outputs "68656c6c6f20776f726c64"
353-
print(buf.hex_decode().get_string_from_utf8())
353+
print(encoded.hex_decode().get_string_from_utf8())
354354
[/gdscript]
355355
[csharp]
356356
var text = "hello world";
357357
var encoded = text.ToUtf8Buffer().HexEncode(); // outputs "68656c6c6f20776f726c64"
358-
GD.Print(buf.HexDecode().GetStringFromUtf8());
358+
GD.Print(encoded.HexDecode().GetStringFromUtf8());
359359
[/csharp]
360360
[/codeblocks]
361361
</description>

0 commit comments

Comments
 (0)