Class SortUtil
java.lang.Object
de.tomatengames.util.SortUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic intCompares the specified strings case-insensitive.
-
Method Details
-
compareNumberPreserving
Compares the specified strings case-insensitive. If the strings contain numbers, the numbers are compared like numbers and not character-wise.Example:
compare("Hello", "Test") => "Hello" < "Test" compare("Test1", "Test2") => "Test1" < "Test2" compare("Test11", "Test2") => "Test11" > "Test2"The stringnullis before all other strings.- Parameters:
s1- The first string. May benull.s2- The second string. May benull.- Returns:
-1ifs1<s2,1ifs1>s2or0ifs1=s2.
-