remove Character from string - Android java.lang

Android examples for java.lang:Character

Description

remove Character from string

Demo Code

public class Main {

  public static String removeCharacter(String orig, String character) {
    String res = "";

    if (orig.contains(character)) {
      res = orig.replaceAll(character, "");
    } else {/* w ww  .  ja v  a  2 s  . c o  m*/
      res = orig;
    }

    return res;
  }

}

Related Tutorials