mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-02-18 08:17:43 +01:00
18 lines
566 B
C#
18 lines
566 B
C#
// Copyright © WireMock.Net
|
|
|
|
#if NET48
|
|
using System.Text.RegularExpressions;
|
|
using WireMock.Constants;
|
|
|
|
// 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, RegexConstants.DefaultTimeout);
|
|
}
|
|
}
|
|
#endif |