From caa88b4611d22092a4ca799bf1807bc780645015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 4 Oct 2019 15:23:12 +0200 Subject: [PATCH] doc: Add note about sending strings without size in StreamPeer Follow-up to #29153. --- doc/classes/StreamPeer.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/classes/StreamPeer.xml b/doc/classes/StreamPeer.xml index 678c587f8de..2a1919071a5 100644 --- a/doc/classes/StreamPeer.xml +++ b/doc/classes/StreamPeer.xml @@ -211,6 +211,10 @@ Puts a zero-terminated ASCII string into the stream prepended by a 32-bit unsigned integer representing its size. + Note: To put an ASCII string without prepending its size, you can use [method put_data]: + [codeblock] + put_data("Hello world".to_ascii()) + [/codeblock] @@ -256,6 +260,10 @@ Puts a zero-terminated UTF-8 string into the stream prepended by a 32 bits unsigned integer representing its size. + Note: To put an UTF-8 string without prepending its size, you can use [method put_data]: + [codeblock] + put_data("Hello world".to_utf8()) + [/codeblock]