I need to write a method which will take a string like "1+2+3*4" and add spaces between each and every character, and remove spaces if there are too many. The string passed in may have spaces / not have spaces, I need to assure there is only one space in between each character.
If someone could please provide the simplest and least complicated way of achieving this, I would be very grateful.
This solution normalizes the whitespace around each operator.