while(someString.indexOf("\"") > 0){ someString = someString.replace(someString.indexOf("\""), someString.indexOf("\"")+1, "'"); }