最佳答案
我有一个字符串 persons.name
我想用 /*/
代替 DOT .
,也就是说我的输出将是 persons/*/name
我试过这个代码:
String a="\\*\\";
str=xpath.replaceAll("\\.", a);
我得到了 StringIndexOutOfBoundsException。
我该怎么替换这个点呢?