diff options
| author | Cody Robibero <cody@robibe.ro> | 2021-12-23 19:38:10 -0700 |
|---|---|---|
| committer | Cody Robibero <cody@robibe.ro> | 2021-12-23 19:38:10 -0700 |
| commit | a04ab6b87637fe378759aaf2b7fa71726150b2b1 (patch) | |
| tree | 62f4e5bdb272e9312bab469cbcda1e13591e7834 /MediaBrowser.Common/Extensions/StringExtensions.cs | |
| parent | c52a2f2f7b130d73a96cdac00f1e63531a04139b (diff) | |
| parent | 8c7dd0a691d150ac4fa5719853554ff569abf1bb (diff) | |
Merge branch 'master' into studios-images-plugin
# Conflicts:
# MediaBrowser.Providers/MediaBrowser.Providers.csproj
Diffstat (limited to 'MediaBrowser.Common/Extensions/StringExtensions.cs')
| -rw-r--r-- | MediaBrowser.Common/Extensions/StringExtensions.cs | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/MediaBrowser.Common/Extensions/StringExtensions.cs b/MediaBrowser.Common/Extensions/StringExtensions.cs deleted file mode 100644 index 764301741..000000000 --- a/MediaBrowser.Common/Extensions/StringExtensions.cs +++ /dev/null @@ -1,37 +0,0 @@ -#nullable enable - -using System; - -namespace MediaBrowser.Common.Extensions -{ - /// <summary> - /// Extensions methods to simplify string operations. - /// </summary> - public static class StringExtensions - { - /// <summary> - /// Returns the part on the left of the <c>needle</c>. - /// </summary> - /// <param name="haystack">The string to seek.</param> - /// <param name="needle">The needle to find.</param> - /// <returns>The part left of the <paramref name="needle" />.</returns> - public static ReadOnlySpan<char> LeftPart(this ReadOnlySpan<char> haystack, char needle) - { - var pos = haystack.IndexOf(needle); - return pos == -1 ? haystack : haystack[..pos]; - } - - /// <summary> - /// Returns the part on the left of the <c>needle</c>. - /// </summary> - /// <param name="haystack">The string to seek.</param> - /// <param name="needle">The needle to find.</param> - /// <param name="stringComparison">One of the enumeration values that specifies the rules for the search.</param> - /// <returns>The part left of the <c>needle</c>.</returns> - public static ReadOnlySpan<char> LeftPart(this ReadOnlySpan<char> haystack, ReadOnlySpan<char> needle, StringComparison stringComparison = default) - { - var pos = haystack.IndexOf(needle, stringComparison); - return pos == -1 ? haystack : haystack[..pos]; - } - } -} |
