public static string ForceReplace([NotNull] this string s, [NotNull] string oldValue, [NotNull] string newValue) { var index = s.IndexOf(oldValue, StringComparison.CurrentCulture); if (index == -1) throw new Exception("Old value not found"); return s.Substring(0, index) + newValue + s.Substring(index + oldValue.Length); }