mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-15 06:43:37 +01:00
15 lines
555 B
C#
15 lines
555 B
C#
#if NET451 || NET452 || NET46 || NET451 || NET461 || NETSTANDARD1_3 || NETSTANDARD2_0
|
|
using System.Text.RegularExpressions;
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
namespace System;
|
|
|
|
internal static class StringExtensions
|
|
{
|
|
public static string Replace(this string text, string oldValue, string newValue, StringComparison stringComparison)
|
|
{
|
|
var options = stringComparison == StringComparison.OrdinalIgnoreCase ? RegexOptions.IgnoreCase : RegexOptions.None;
|
|
return Regex.Replace(text, oldValue, newValue, options);
|
|
}
|
|
}
|
|
#endif |