From dec7cb55482f83f8a2472c92c8cfe96d1854d6f1 Mon Sep 17 00:00:00 2001 From: Ninni Pipping Date: Tue, 20 Jun 2023 10:41:53 +0200 Subject: [PATCH] [3.x] Clarify `String.get_slice` behavior Clarify that the function returns the whole string if there is no instances of the delimiter in the string. --- doc/classes/String.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/classes/String.xml b/doc/classes/String.xml index b3b3c232400..cc58f025c37 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -358,7 +358,7 @@ - Splits a string using a [code]delimiter[/code] and returns a substring at index [code]slice[/code]. Returns an empty string if the index doesn't exist. + Splits a string using a [code]delimiter[/code] and returns a substring at index [code]slice[/code]. Returns the original string if [code]delimiter[/code] does not occur in the string. Returns an empty string if the index doesn't exist. This is a more performant alternative to [method split] for cases when you need only one element from the array at a fixed index. Example: [codeblock]