I am trying to remove whitespace (dynamically) from an input string:
Input: ' inputString '
Output: 'inputString'
Input: ' Ravi kumar '
Output: 'Ravi kumar'
I want to remove the space before or after the string or both before and after, not in the middle.
I tried the following but it is removing all the spaces including middle.
inputString = inputString.replaceAll('\\s+', '');