Skip to content

Instantly share code, notes, and snippets.

@wjlafrance
Created February 2, 2012 07:25
Show Gist options
  • Save wjlafrance/1722168 to your computer and use it in GitHub Desktop.
Save wjlafrance/1722168 to your computer and use it in GitHub Desktop.
// Java sorts numbers before letters, so if one is a letter and one is a number,
// flip their sort ordering
if (Character.isDigit(ourName.charAt(0)) ^ Character.isDigit(theirName.charAt(0)))
return ourName.compareTo(theirName) * -1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment