aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common/Extensions/StringExtensions.cs
diff options
context:
space:
mode:
authorBaronGreenback <jimcartlidge@yahoo.co.uk>2021-02-28 10:12:14 +0000
committerBaronGreenback <jimcartlidge@yahoo.co.uk>2021-02-28 10:12:14 +0000
commit80ca3da55c7d8ec9cf06a619fc895c1e427c45ff (patch)
tree95f5ddce05f6ede680b815cfe5dbf413ce6fb352 /MediaBrowser.Common/Extensions/StringExtensions.cs
parent1d6f489f17919e557987b2616048dc8def790f43 (diff)
parentf8c9c37c29efa6d42b79d6db3aa8a69a60106765 (diff)
Merge remote-tracking branch 'upstream/master' into FixFor5280Part2
Diffstat (limited to 'MediaBrowser.Common/Extensions/StringExtensions.cs')
-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];
- }
- }
-}