Examples of NewLineReader


Examples of ch.inftec.ju.util.io.NewLineReader

  public static XString parseLines(String s) {
    if (s == null || s.isEmpty()) {
      return new XString("");
    } else {
      XString xs = new XString();
      try (NewLineReader r = new NewLineReader(new StringReader(s))) {
        LineIterator i = r.iterateLines();
        while (i.hasNext()) {
          xs.addLine(i.nextLine());
        }
        // Use the new line strategy of the input, provided we got some.
        // Otherwise we'll just leave the XString's default setting, which
        // is \n (NEW_LINE)
        if (r.getInputNewLine() != null) {
          xs.setLineBreak(r.getInputNewLine());
        }
        return xs;
      } catch (Exception ex) {
        throw new JuRuntimeException("Couldn't parse String", ex);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.