diff options
| author | Bond_009 <bond.009@outlook.com> | 2020-04-21 10:18:26 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2020-04-21 10:18:26 +0200 |
| commit | c430a7ed8faa40788c32b89852310981b7c1cf83 (patch) | |
| tree | 4622517191f8e074cd61c6d0a2810dbbdd89007f /MediaBrowser.Common/Extensions/StringExtensions.cs | |
| parent | 958681cdffddc7ea24d92d126badb3372cfa5d41 (diff) | |
Address comments
Diffstat (limited to 'MediaBrowser.Common/Extensions/StringExtensions.cs')
| -rw-r--r-- | MediaBrowser.Common/Extensions/StringExtensions.cs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/MediaBrowser.Common/Extensions/StringExtensions.cs b/MediaBrowser.Common/Extensions/StringExtensions.cs index 2ac29f8e5..764301741 100644 --- a/MediaBrowser.Common/Extensions/StringExtensions.cs +++ b/MediaBrowser.Common/Extensions/StringExtensions.cs @@ -10,28 +10,28 @@ namespace MediaBrowser.Common.Extensions public static class StringExtensions { /// <summary> - /// Returns the part left of the <c>needle</c>. + /// Returns the part on the left of the <c>needle</c>. /// </summary> - /// <param name="str">The string to seek.</param> + /// <param name="haystack">The string to seek.</param> /// <param name="needle">The needle to find.</param> - /// <returns>The part left of the <c>needle</c>.</returns> - public static ReadOnlySpan<char> LeftPart(this ReadOnlySpan<char> str, char needle) + /// <returns>The part left of the <paramref name="needle" />.</returns> + public static ReadOnlySpan<char> LeftPart(this ReadOnlySpan<char> haystack, char needle) { - var pos = str.IndexOf(needle); - return pos == -1 ? str : str[..pos]; + var pos = haystack.IndexOf(needle); + return pos == -1 ? haystack : haystack[..pos]; } /// <summary> - /// Returns the part left of the <c>needle</c>. + /// Returns the part on the left of the <c>needle</c>. /// </summary> - /// <param name="str">The string to seek.</param> + /// <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> str, ReadOnlySpan<char> needle, StringComparison stringComparison = default) + public static ReadOnlySpan<char> LeftPart(this ReadOnlySpan<char> haystack, ReadOnlySpan<char> needle, StringComparison stringComparison = default) { - var pos = str.IndexOf(needle, stringComparison); - return pos == -1 ? str : str[..pos]; + var pos = haystack.IndexOf(needle, stringComparison); + return pos == -1 ? haystack : haystack[..pos]; } } } |
