我已经看到将“,”替换为“。” 通过使用 ".$"|",$",但此逻辑不适用于字母。我需要使用java将包含EXAMPLE_TEST的字符串中的所有单词的最后一个字母替换为另一个字母这是我的代码
Pattern replace = Pattern.compile("n$");//here got the real problem
matcher2 = replace.matcher(EXAMPLE_TEST);
EXAMPLE_TEST=matcher2.replaceAll("k");
我也试过 "//n$" ,"\n$" 等 请帮我获得解决方案 input text=>njan ayman output text=> njak aymak