public static String removeChar(char c,String string){
  int nextChar=string.indexOf(c);
  if (nextChar == -1)   return string;
  int start=0;
  StringBuilder ret=new StringBuilder(string.length() - 1);
  while (nextChar != -1) {
    ret.append(string,start,nextChar);
    start=nextChar + 1;
    nextChar=string.indexOf(c,start);
  }
  ret.append(string,start,string.length());
  return ret.toString();
}

public static String removeChar ( char c , String string ) { int nextChar = string . indexOf ( c ) ; if ( nextChar == - 1 ) return string ; int start = 0 ; StringBuilder ret = new StringBuilder ( string . length ( ) - 1 ) ; while ( nextChar != - 1 ) { ret . append ( string , start , nextChar ) ; start = nextChar + 1 ; nextChar = string . indexOf ( c , start ) ; } ret . append ( string , start , string . length ( ) ) ; return ret . toString ( ) ; }
removes the given character from the given string . more efficient than using string . replace which uses regexes .
