summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-01-18 10:50:43 +0100
committerGitHub <noreply@github.com>2022-01-18 10:50:43 +0100
commit38a54084bec22a51054c4410e193f69a6488a13a (patch)
tree981a8fe9017359fc5cc2a5fd9cdec83c74222ec1
parent045648d09166377500630c606a447857cd841fc0 (diff)
parent176a9c738fed0ed139d6971c089157bfc80b30f9 (diff)
Merge pull request #56826 from noidexe/patch-3
-rw-r--r--doc/classes/Array.xml6
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml
index 5b1861bc9a..7cb6f71190 100644
--- a/doc/classes/Array.xml
+++ b/doc/classes/Array.xml
@@ -470,6 +470,12 @@
// There is no sort support for Godot.Collections.Array
[/csharp]
[/codeblocks]
+ To perform natural order sorting, you can use [method sort_custom] with [method String.naturalnocasecmp_to] as follows:
+ [codeblock]
+ var strings = ["string1", "string2", "string10", "string11"]
+ strings.sort_custom(func(a, b): return a.naturalnocasecmp_to(b) &lt; 0)
+ print(strings) # Prints [string1, string2, string10, string11]
+ [/codeblock]
</description>
</method>
<method name="sort_custom">