java replace German umlauts

后端 未结 8 808
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-31 06:24

I have the following problem. I am trying to replace german umlauts like ä, ö, ü in java. But it simply does not work. Her

8条回答
  •  盖世英雄少女心
    2020-12-31 07:17

    I've just tried to run it and it runs fine.

    If you're not using regular expressions then i'd use string.replace rather than string.replaceAll as it's slightly quicker than the latter. The difference between them mainly being that replaceAll can handle regex's.

    EDIT: Just noticed people in the comments have the said the same before me so if you've read theres you can pretty much ignore what I said, as stated the problem exists elsewhere in your code as that snippet works as expected.

提交回复
热议问题