Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String filterInvalid(String xml) {
        StringBuffer sb = new StringBuffer(xml);
        for (int i = 0; i < sb.length(); i++) {
            int c = sb.charAt(i);
            if (c < 0x20 && c != 0x09/*\t*/ && c != 0x0A/*\n*/ && c != 0x0D/*\r*/) {
                sb.delete(i, i + 1);
            }
        }
        return sb.toString();
    }
}