code: public static String trimInFront(String buffer) {
          // remove spaces in front
          int count = 0;
          for (int i = 0; i < buffer.length(); i++) {
              if (buffer.charAt(i) == SPACE_CHAR)
                  count++;
              else
                  break;
          }
          if (count > 0)
              return buffer.substring(count);
          else
              return buffer;
      }
docs: Only trim space in front of the word
  
  @param buffer input
  @return trimmed buffer