public String replace(String data, String what, String replace){
        String tmp1 = data.toLowerCase();
        String tmp2 = what.toLowerCase();
        int i = what.length();
        StringBuffer stringbuffer = new StringBuffer();
        int j = 0;
        for(int k = tmp1.indexOf(tmp2, j); k > -1; k = tmp1.indexOf(tmp2, j)){
            try{
                stringbuffer.append(data.substring(j, k));
                stringbuffer.append(replace);
                j = k + i;
            }catch(StringIndexOutOfBoundsException stringindexoutofboundsexception){
                j++;
            }
        }
        try{
            stringbuffer.append(data.substring(j));
        }catch(StringIndexOutOfBoundsException stringindexoutofboundsexception1){}
        String result = stringbuffer.toString();
        return result.trim();
    }