public static String replace(String from, String to, String source)
  {
    if ((source == null) || (from == null) || (to == null))
      return null;
    StringBuffer str = new StringBuffer("");
    int index = -1;
    while ((index = source.indexOf(from)) != -1) {
      str.append(source.substring(0, index) + to);
      source = source.substring(index + from.length());
      index = source.indexOf(from);
    }
    str.append(source);
    return str.toString();
  }