CCNet.Build.Common.Util.ReplaceIgnoreCase C# (CSharp) Method

ReplaceIgnoreCase() public static method

Performs case-insensitive string replacement.
public static ReplaceIgnoreCase ( this input, string search, string replacement ) : string
input this
search string
replacement string
return string
		public static string ReplaceIgnoreCase(this string input, string search, string replacement)
		{
			// xxx TODO: put into Atom
			// xxx maybe this is faster http://stackoverflow.com/questions/6025560/how-to-ignore-case-in-string-replace
			return Regex.Replace(
				input,
				Regex.Escape(search),
				replacement.Replace("$", "$$"),
				RegexOptions.IgnoreCase
			);
		}
	}