Android String Replace removeIllegal(String input)

Here you can find the source of removeIllegal(String input)

Description

remove Illegal

License

Open Source License

Declaration

public static String removeIllegal(String input) 

Method Source Code

//package com.java2s;
/*//from  w w  w  .j  a v  a2s  . c  o  m
 * Tomdroid
 * Tomboy on Android
 * http://www.launchpad.net/tomdroid
 * 
 * Copyright 2009, Benoit Garret <benoit.garret_launchpad@gadz.org>
 * 
 * This file is part of Tomdroid.
 * 
 * Tomdroid is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Tomdroid is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Tomdroid.  If not, see <http://www.gnu.org/licenses/>.
 */

public class Main {
    public static String removeIllegal(String input) {

        String invalidXMLChars = "[^[\\u0009\\u000A\\u000D][\\u0020-\\uD7FF][\\uE000-\\uFFFD][\\u10000-\\u10FFFF]]";

        return input.replaceAll(invalidXMLChars, "?");
    }
}

Related

  1. replaceWordsAll(String src, String targetValue, String newValue)
  2. replaceBlank(String str)
  3. replaceBlank(String str)
  4. replaceBlank(String str)
  5. replaceBlank(String str)
  6. replace(String s, String[] oldSubs, char[] newSubs)
  7. replace(String s, char oldSub, String newSub)
  8. replace(String s, char oldSub, char newSub)
  9. replace(String source, CharSequence target, CharSequence replacement)