Java tutorial
//package com.java2s; //License from project: Apache License public class Main { public static String filterCharacters(String xml) { char[] array = xml.toCharArray(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < array.length; i++) { if (xml.charAt(i) < 0x9 || (xml.charAt(i) > 0xa && xml.charAt(i) < 0xf)) { } else { sb.append(array[i]); } } return sb.toString(); } }