>public static partial class ExtensionMethods > { > > public static string ChrTran(this string s, string from, string to) > { > var sb = new StringBuilder(s, s.Length); > > int i, j, toLen = to.Length; > > for (i = sb.Length; --i >= 0; ) > { > if ((j = from.IndexOf(sb[i])) >= 0) > { > if (j < toLen) > { > sb[i] = to[j]; > } > else > { > sb.Remove(i, 1); > } > } > } > > return sb.ToString(); > } > > } >I was thinking we need to use multiple replace commands. Do you think this is the best implementation? I want to add this to our extension methods as I need this function also.