我有不喜欢美元符号的代码,必须在替换时可见。
String s1= "this is amount <AMOUNT> you must pay";
s1.replaceAll("<AMOUNT>", "$2.60");
System.out.print(s1);
我有例外java.lang.IllegalArgumentException: Illegal group reference
我渴望得到字符串"this is amount $2.60 you must pay"
如何更改我的代码以获得所需的结果?