How can I remove spaces and tabs from begining of a string. I can't use
" Ab z m".replaceAll( "\\s+", "" ); //
because It will remove all the spaces even between Ab , z and m.
What I really need is only to check if there is a space or tabs in the string I have to remove them. Note that I read the string from a file line by line, so each line is different from the other.
I tried this solution, but it did not work too because some times the string has no space or tabs in the begining.
String tabs = "Ab z m"; // it works well if tabs = " Ab z m";
String[] parts = tabs.split(" ", 2);
System.out.println(parts[1]);
Thanks a lot