How to replace umlauts in a string?

大城市里の小女人 提交于 2019-12-09 13:11:45

问题


Is there any good library that performs conversation of umlauts and special characters to their "flat" representation? Eg:

Ä -> AE
Ü -> UE
ß -> ss

Anything you could advise?


回答1:


use StringUtils, This is not the well-known apache library . That is solve your issue.

replaceUmlauts

public static java.lang.String replaceUmlauts(java.lang.String string)

Replaces all umlauts in a string.
Umlaut  Replacement
ä   ae
ö   oe
ü   ue
ß   ss

Parameters:
    string - String, where the umlauts has to be replaced 
Returns:
    String without umlauts


来源:https://stackoverflow.com/questions/20420080/how-to-replace-umlauts-in-a-string

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!