I need to replace all “&” symbols with “&” in my text file but not the html codes such as & or "
I’m currently using row = row.replace("& ", "&");
but, as I said also the html codes are replaced e.g. " and I don’t want this..
thanks
ps. I cannot add spaces after & because I need to replace it in words such as M&M or Ella & David
You could try a regex, e.g,
The regex replace
&given that it’s not followed bya sequence of '#a-zA-Z0-9' ending with ';'