aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common/Extensions
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2021-02-22 21:00:34 -0500
committerGitHub <noreply@github.com>2021-02-22 21:00:34 -0500
commitc0c4aff8a642013ec406c065c8374aaad8b4ef65 (patch)
treea3b861cbb472ddc7e72ed87df14e9e7a0481f7e0 /MediaBrowser.Common/Extensions
parentda55462d92f645d20f63eab3d7ffc8e141497ac5 (diff)
parentb1fe28d0a6c1bbc67543fc1b5877a69f7958f8c5 (diff)
Merge pull request #5276 from Bond-009/minor12
Diffstat (limited to 'MediaBrowser.Common/Extensions')
-rw-r--r--MediaBrowser.Common/Extensions/StringExtensions.cs37
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];
- }
- }
-}