Utils.java Source code

Java tutorial

Introduction

Here is the source code for Utils.java

Source

public class Utils {

    public static String stripCDATA(String s) {
        s = s.trim();
        if (s.startsWith("<![CDATA[")) {
            s = s.substring(9);
            int i = s.indexOf("]]&gt;");
            if (i == -1) {
                throw new IllegalStateException("argument starts with <![CDATA[ but cannot find pairing ]]&gt;");
            }
            s = s.substring(0, i);
        }
        return s;
    }

}