[Solved] String parsing, replace new line character
Strings are immutable in Java – operations like replace don’t actually update the original string. You have to use the return value of the substring call, e.g. String updated = str.substring(j,str.indexOf(‘>’,j+1)).replaceAll(“\n”, “#10”); If you want to replace this in the overall string, you can simply concatenate this back into the string: int indexOf = str.indexOf(‘>’,j+1); … Read more