ETLBox/src/Helper/StringExtension.cs
/// <summary>
///		This replicates the functionality of case-insensitive functionality built into Replace in .Net Core.
/// </summary>
/// <param name="toSearch"></param>
/// <param name="find"></param>
/// <param name="replace"></param>
/// <returns></returns>
This replicates the functionality of case-insensitive functionality built into Replace in .Net Core.
This replicates the functionality of case - insensitive functionality built into Replace in . Net Core .
public static string ReplaceIgnoreCase(this string toSearch, string find, string replace)
		{
			int index = toSearch.IndexOf(
				find,
				System.StringComparison.InvariantCultureIgnoreCase);
			if (index < 0)
			{
				return toSearch;
			}
			string replacement = toSearch.Substring(0, index) + replace;
			if (toSearch.Length > index + find.Length)
			{
				replacement += toSearch.Substring(index + find.Length);
			}
			return replacement;
		}
public static string ReplaceIgnoreCase ( this string toSearch , string find , string replace ) { int index = toSearch . IndexOf ( find , System . StringComparison . InvariantCultureIgnoreCase ) ; if ( index < 0 ) { return toSearch ; } string replacement = toSearch . Substring ( 0 , index ) + replace ; if ( toSearch . Length > index + find . Length ) { replacement += toSearch . Substring ( index + find . Length ) ; } return replacement ; }
This replicates the functionality of case-insensitive functionality built into Replace in .Net Core.
This replicates the functionality of case - insensitive functionality built into Replace in . Net Core .
None
string
this
find
string
None
replace
string
None
toSearch
None