Remove character in a given string

class RemoveChar{
public static void main(String args[]){
String val=removeChar("Madhusudhan Reddy",'u');

public static String removeChar(String s, char c) {

   String r = "";

   for (int i = 0; i < s.length(); i ++) {
      if (s.charAt(i) != c) r += s.charAt(i);

   return r;


Popular posts from this blog

Android Objective type Question and Answers

Android Questions and Answers for written exams