Remove first white space in Java

java

Solution

Just use `str.trim()` to get rid of all leading and trailing spaces.

Problem

How would I remove the first white-space in Java? Right now I am using this: ``` if (str.charAt(0) == ' ') str = str.replace(" ", ""); ```

Original source