I want a regular expression which can remove spaces before or after = in java.
For example consider a string
String str="Name = Aniket";
I want the result to contain a strring which contains no spaces before or after =. That is result should contain "Name=Aniket".
How to do it in java?
The following solution will remove all whitespace before and after a
=, just as it should do in the example you provide.will get rid of whitespace before and after every
=, and leave the=where it was.