diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2019-10-27 13:52:08 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-27 13:52:08 -0400 |
| commit | 53ee78170ad3d5d5d0ecac2dbe8dcbfb13940e46 (patch) | |
| tree | 1ad4126058814609352d41b78662fd5838d6677a /Emby.Naming/Extensions/StringExtensions.cs | |
| parent | 2cdf5c203a9335100b19b9609a738e1b64d6631d (diff) | |
| parent | c9f4a74af02e08b895cd6a8b8a408b1c0edfb6c4 (diff) | |
Merge branch 'master' into copr-fix
Diffstat (limited to 'Emby.Naming/Extensions/StringExtensions.cs')
| -rw-r--r-- | Emby.Naming/Extensions/StringExtensions.cs | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/Emby.Naming/Extensions/StringExtensions.cs b/Emby.Naming/Extensions/StringExtensions.cs deleted file mode 100644 index 5512127a8..000000000 --- a/Emby.Naming/Extensions/StringExtensions.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Text; - -namespace Emby.Naming.Extensions -{ - public static class StringExtensions - { - // TODO: @bond remove this when moving to netstandard2.1 - 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(); - } - } -} |
