Compares two strings in a way that is natural to humans. Integers come before non-integers, and integers are compared as if they were numbers instead of strings of characters. Intended for usage in opCmp overloads.
-1 if a comes before b, 0 if a and b are equal, 1 if a comes after b
struct someStruct { string someText; int opCmp(someStruct b) { return compareNatural(this.someText, b.someText); } }
See Implementation
Compares two strings in a way that is natural to humans. Integers come before non-integers, and integers are compared as if they were numbers instead of strings of characters. Intended for usage in opCmp overloads.