@@ -0,0 +1,1399 @@
+/**%0A * %0A */%0Apackage com.ctgi.google.arraysandstrings;%0A%0A/**%0A * @author Dany%0A *%0A * ALGORITHM: (Remove all occurrences a specific character from the input string)%0A * - Get the input string and character c%0A * - convert that to a character array%0A * - make two pointers. i.One iterate through all the characters in the array%0A *   ii. Another if it find the char%0A */%0Apublic class StringReplaceChar %7B%0A%0A%09/**%0A%09 * @param args%0A%09 */%0A%09public static void main(String%5B%5D args) %7B%0A%09%09// TODO Auto-generated method stub%0A%0A%09%09String res = new StringReplaceChar().replaceChar1(%22Bloomborg%22, 'o');%0A%0A%09%09System.out.println(res);%0A%09%09/*for(int i=0;i%3Cres.length;i++)%0A%09%09%7B%0A%09%09%09System.out.print(res%5Bi%5D);%0A%09%09%7D*/%0A%09%7D%0A%0A%09public char%5B%5D replaceChar(String str, char c)%0A%09%7B%0A%09%09int j=0;%0A%09%09boolean isCharAvail=false;%0A%09%09char%5B%5D cArr=str.toCharArray();%0A%09%09for(int i=0;i%3CcArr.length;i++)%0A%09%09%7B%0A%09%09%09if(!isCharAvail)%0A%09%09%09%09j=i;%0A%0A%09%09%09while(cArr%5Bj%5D==c)%0A%09%09%09%7B%0A%09%09%09%09j++;%0A%09%09%09%09isCharAvail=true;%0A%0A%09%09%09%7D%0A%0A%0A%09%09%09if(i+1%3CcArr.length && (j+1%3CcArr.length))%0A%09%09%09%7B%0A%09%09%09%09cArr%5Bi%5D=cArr%5Bj++%5D;%0A%0A%0A%09%09%09%7D%0A%0A%09%09%09if(j+1==cArr.length)%0A%09%09%09%09cArr%5Bi%5D='%5C0';%0A%0A%09%09%7D%0A%09%09return cArr;%0A%09%7D%0A%0A%09public String replaceChar1(String str, char c)%0A%09%7B%0A%09%09int j=0;%0A%09%09char%5B%5D cArr=str.toCharArray(); //Bloomberg%0A%09%09for(int i=0;i%3CcArr.length;i++)%0A%09%09%7B%0A%09%09%09if(cArr%5Bi%5D!=c)%0A%09%09%09%7B%0A%09%09%09%09cArr%5Bj%5D=cArr%5Bi%5D;%0A%09%09%09%09j++;%0A%09%09%09%7D%0A%09%09%09else%0A%09%09%09%7B%0A%09%09%09%09cArr%5Bj%5D=cArr%5Bi%5D;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09cArr%5Bj%5D = '%5C0';%0A%09%09String res = new String(cArr, 0, j);%0A%09%09return res;%0A%09%7D%0A%0A%7D%0A

String replace all occurances of char