public static String replace(String inString, String oldValue, String newValue) { if (inString == null || oldValue == null || oldValue.equals(""))
return inString; if (newValue == null)
newValue = "";

int pos = 0; while ( (pos=inString.indexOf(oldValue,pos)) > -1 ) {
inString = inString.substring(0,pos) + newValue + inString.substring(pos+oldValue.length());
pos += newValue.length();
} return inString;}