how to remove spaces from the beggining of strings in java code example Example: java 8 remove spaces from string a.replaceAll("\\s+","");