private boolean startsWithSpace(String str){
  return str.length() != 0 && str.charAt(0) == ' ';
}

private boolean startsWithSpace ( String str ) { return str . length ( ) != 0 && str . charAt ( 0 ) == ' ' ; }
checks if the string starts with a space character , false if the string is empty or starts with a non - space character .
