java - 如何删除所有扩展 ASCII 字符,但不删除变音符号?

标签 java ascii

我想从输入中删除所有 ASCII 扩展字符。 (引用:http://www.theasciicode.com.ar/extended-ascii-code/letter-a-umlaut-diaeresis-a-umlaut-lowercase-ascii-code-132.html)。

因此我可以使用 CharMatcher.ASCII,但我还想保留包含在扩展字符集中的德语变音符号。 那么,我该如何实现呢?

最佳答案

如果你想使用 Guava CharMatcher这个任务的类,那么你可以使用 and(CharMatcher)or(CharMatcher) 方法等来组合匹配器。例如:

CharMatcher asciiPlusUmlauts = 
    CharMatcher.ASCII.or(CharMatcher.anyOf("ÄäÖöÜüß"));

你明白了吗?

关于java - 如何删除所有扩展 ASCII 字符,但不删除变音符号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24547462/

相关文章:

java - 从核心转储中提取堆转储 (hprof)

ssl - certbot 更新/certonly 破折号错误 : 'ascii' codec can't decode byte

c# - 将非 ASCII 域转换为 SMTP 兼容

java - 从 API (OkHttp) 刷新时 RecyclerView 无法滚动,因 IndexOutOfBoundsException 而崩溃

java - Eclipse IDE - Classnotfound 异常,即使路径已知。为什么 Eclipse 可以在一个项目中找到库,而在另一个项目中找不到?

java - 优化拖动代码

java - 将字母数字转换为 ascii 并递增

java - 如何链接多个 RxJava 的 groupBy() 方法,例如 groupBy().groupBy()

javascript - 为网格中的交叉点确定正确字符 ['╦' 、 '╣' 、 '╠' 、 '╩' 、 '╬' ] 的算法

android - 如何以编程方式输入新行?