Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/*
 * The following methods come from a library written by Tom Fennelly.
 * Here was the header of the licence.
 */

public class Main {
    public static String removeHeaderDirective(String xml) {
        int indexOfDirStart = xml.indexOf("<?");
        if (indexOfDirStart == -1)
            return (xml);

        int indexOfDirEnd = xml.indexOf("?>", indexOfDirStart + 2);
        if (indexOfDirEnd == -1)
            return (xml);

        return (xml.substring(xml.indexOf("<", indexOfDirEnd + 2)));
    }
}