From d26707708d7b396d0eb4a61035a30f7bfbcb33f8 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 17 Jan 2015 15:12:02 -0500 Subject: move string.Replace extension --- MediaBrowser.Common/Extensions/BaseExtensions.cs | 30 ------------------------ 1 file changed, 30 deletions(-) (limited to 'MediaBrowser.Common/Extensions/BaseExtensions.cs') diff --git a/MediaBrowser.Common/Extensions/BaseExtensions.cs b/MediaBrowser.Common/Extensions/BaseExtensions.cs index 4c94f3aa2..22dfa378f 100644 --- a/MediaBrowser.Common/Extensions/BaseExtensions.cs +++ b/MediaBrowser.Common/Extensions/BaseExtensions.cs @@ -26,36 +26,6 @@ namespace MediaBrowser.Common.Extensions return Regex.Replace(htmlString, pattern, string.Empty).Trim(); } - /// - /// Replaces the specified STR. - /// - /// The STR. - /// The old value. - /// The new value. - /// The comparison. - /// System.String. - public static string Replace(this string str, string oldValue, string newValue, StringComparison comparison) - { - var sb = new StringBuilder(); - - var previousIndex = 0; - var index = str.IndexOf(oldValue, comparison); - - while (index != -1) - { - sb.Append(str.Substring(previousIndex, index - previousIndex)); - sb.Append(newValue); - index += oldValue.Length; - - previousIndex = index; - index = str.IndexOf(oldValue, index, comparison); - } - - sb.Append(str.Substring(previousIndex)); - - return sb.ToString(); - } - public static string RemoveDiacritics(this string text) { return String.Concat( -- cgit v1.2.3