Add IgnoreCase option to ProxyUrlReplaceSettings (#925)

* Add IgnoreCase option to ProxyUrlReplaceSettings

* fix
This commit is contained in:
Stef Heyenrath
2023-04-23 11:56:08 +02:00
committed by GitHub
parent 9ef8bd0b7b
commit 0a2763c06e
4 changed files with 36 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
#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