Is there a Comparator
implementation in Guava to sort strings in a "natural" way that may contain numbers?
Eg:
"a 8"
"a 9"
"a 10"
I found some interesting links regarding this, but it looks like there is nothing in guava to do the job...
StackOverflow: "Sort on a String that may contain a number"
A good explanation of the: The Alphanum Algorithm
No, there isn't any built in implementation of such a comparator in Guava... seems like something that's too narrowly applicable to me. Just write your own implementation or use one of the existing ones that have been linked already.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With