Ignoring diacritic characters when comparing words with special characters (é, è, …)

前端 未结 8 1595
梦如初夏
梦如初夏 2021-02-05 18:08

I have a list with some Belgian cities with diacritic characters: (Liège, Quiévrain, Franière, etc.) and I would like to transform these special characters to compare with a lis

8条回答
  •  轮回少年
    2021-02-05 18:29

    For those looking for a clean java solution, use apache commons:

    StringUtils.stripAccents("Liège").toUpperCase();
    

    this will return

    LIEGE
    

提交回复
热议问题