How to remove white spaces on either side of '=' sign? [on hold]
I have a string attr1 = 45 attr2 =\"82\".
I want a regex that produces attr1=45 attr2="82" eliminating any
whitespace on either side of the equals sign (=).
String string = " bob= 4 att1 =\"4\"";
string = string.replaceAll("\\s+", "");
I get the following output: attr1=45attr2="82"
Help?
No comments:
Post a Comment