code: public static String normalize(final CharSequence self) {
          final String s = self.toString();
          int nx = s.indexOf('\r');
  
          if (nx < 0) {
              return s;
          }
  
          final int len = s.length();
          final StringBuilder sb = new StringBuilder(len);
  
          int i = 0;
  
          do {
              sb.append(s, i, nx);
              sb.append('\n');
  
              if ((i = nx + 1) >= len) break;
  
              if (s.charAt(i) == '\n') {
                  // skip the LF in CR LF
                  if (++i >= len) break;
              }
  
              nx = s.indexOf('\r', i);
          } while (nx > 0);
  
          sb.append(s, i, len);
  
          return sb.toString();
      }
docs: Return a String with linefeeds and carriage returns normalized to linefeeds.
  
  @param self a CharSequence object
  @return the normalized toString() for the CharSequence
  @see #normalize(String)
  @since 1.8.2