diff options
Diffstat (limited to 'Emby.Server.Implementations/TextEncoding/NLangDetect/Extensions/StringExtensions.cs')
| -rw-r--r-- | Emby.Server.Implementations/TextEncoding/NLangDetect/Extensions/StringExtensions.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Emby.Server.Implementations/TextEncoding/NLangDetect/Extensions/StringExtensions.cs b/Emby.Server.Implementations/TextEncoding/NLangDetect/Extensions/StringExtensions.cs index 1ea92232b..c60757c02 100644 --- a/Emby.Server.Implementations/TextEncoding/NLangDetect/Extensions/StringExtensions.cs +++ b/Emby.Server.Implementations/TextEncoding/NLangDetect/Extensions/StringExtensions.cs @@ -14,11 +14,11 @@ namespace NLangDetect.Core.Extensions /// <exception cref="IndexOutOfRangeException"> if start or end are negative, if end is greater than length(), or if start is greater than end</exception> public static string SubSequence(this string s, int start, int end) { - if (start < 0) throw new ArgumentOutOfRangeException("start", "Argument must not be negative."); - if (end < 0) throw new ArgumentOutOfRangeException("end", "Argument must not be negative."); - if (end > s.Length) throw new ArgumentOutOfRangeException("end", "Argument must not be greater than the input string's length."); - if (start > end) throw new ArgumentOutOfRangeException("start", "Argument must not be greater than the 'end' argument."); - + if (start < 0) throw new ArgumentOutOfRangeException(nameof(start), "Argument must not be negative."); + if (end < 0) throw new ArgumentOutOfRangeException(nameof(end), "Argument must not be negative."); + if (end > s.Length) throw new ArgumentOutOfRangeException(nameof(end), "Argument must not be greater than the input string's length."); + if (start > end) throw new ArgumentOutOfRangeException(nameof(start), "Argument must not be greater than the 'end' argument."); + return s.Substring(start, end - start); } } |
