docs: public static int lengthWithoutLinefeed(CharSequence line) {
      int length = line.length();
      while(length > 0) {
        char last = line.charAt(length - 1);
        if(last != '\n' && last != '\r') {
          break;
        }
        --length;
      }
      return length;
    }