如何替换字符串中的变音符? [英] How to replace umlauts in a string?

查看:83
本文介绍了如何替换字符串中的变音符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一个好的库可以将变音符号和特殊字符转换为扁平表示形式?例如:

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

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

有什么可以建议的吗?

推荐答案

使用 StringUtils ,这不是众所周知的apache库。那就是解决您的问题。

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

这篇关于如何替换字符串中的变音符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆