首页 > 解决方案 > Sorting is causing a problem with apostrophe

问题描述

I have an ArrayList of Strings called arrayStr. I am using:

Collections.sort(arrayStr)

to sort this ArrayList. However, I have one minor inconvenience when doing this.

Let's say there is a word called Mary in the ArrayList and there is another word called Mary's. The word Mary's will come before Mary when I sort the list, but I need it to come right after Mary.

Does anyone know how to fix this?

标签: stringsortingarraylistcollectionsapostrophe

解决方案


推荐阅读