I'm trying to parse some extracted data. So, I can't find how do I to replace a detected String in Java?
I've tried this, but it doesn't work for me :
texte.replace("gras", "bold");
Any help please ?
字符串是不可变的。您需要将返回的字符串分配给字符串变量。例如
texte = texte.replace("gras", "bold");
或者
String replaced = texte.replace("gras", "bold");
字符串是不可变的,将结果分配回 texte
字符串是不可变的,在字符串上调用方法永远不会改变它。
texte = texte.replace("gras", "bold");
应该做的伎俩