我在替换用户输入字符串中的特定字符串时遇到问题,但是没有生成预期的输出.
String inputString="hellol lol";
String result = inputString.replaceAll("lol", "laugh out loud");
System.out.println("Normal Form:" + result);
Run Code Online (Sandbox Code Playgroud)
输入: hellol lol
代码输出: hellaugh out loud laugh out loud
预期产量: hellol laugh out loud
我该如何解决?谢谢.