Merge pull request #56826 from noidexe/patch-3

This commit is contained in:
Rémi Verschelde 2022-01-18 10:50:43 +01:00 committed by GitHub
commit 38a54084be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) < 0)
print(strings) # Prints [string1, string2, string10, string11]
[/codeblock]
</description>
</method>
<method name="sort_custom">