Utils.java Source code

Java tutorial

Introduction

Here is the source code for Utils.java

Source

import java.io.UnsupportedEncodingException;

public class Utils {
    public static String fixLineSeparator(String xml) throws UnsupportedEncodingException {
        if ("\r\n".equals(System.getProperty("line.separator"))) {
            xml = xml.replaceAll("\r[^\n]", System.getProperty("line.separator"));
        } else {
            xml = xml.replaceAll("\r\n", System.getProperty("line.separator"));
        }

        return xml;
    }
}