Natural sort order string comparison in Java – is one built in? [duplicate]

In java the “natural” order meaning is “lexicographical” order, so there is no implementation in the core like the one you’re looking for.

There are open source implementations.

Here’s one:

NaturalOrderComparator.java

Make sure you read the:

Cougaar Open Source License

I hope this helps!

Leave a Comment