public static string Replace([NotNull] this string s, [NotNull] string oldValue, [NotNull] string newValue, StringComparison comparison) { var index = s.IndexOf(oldValue, comparison); return index != -1 ? s.Substring(0, index) + newValue + s.Substring(index + oldValue.Length) : s; }