public static String replace(String s, char from, char to){
        //do not use equals as this will not work properly on chars
        if((s.length()==1)&&(s.charAt(0)==from)){
            return ""+to;
        }
        else if(s.length()==0){
            return "";
        }
        else{
            //do not try to use equals as this will not work properly on chars
            if(s.charAt(s.length()-1)==from){
                return replace(s.substring(0, s.length()-1), from, to)+ ""+to;
            }
            else{
                return replace(s.substring(0, s.length()-1), from, to)+ s.substring(s.length()-1);
            }

        }
    }