|
|
@@ -14,11 +14,11 @@ internal static class StringHelper
|
|
|
public static ReadOnlySpan<char> Slice(string s, int i, int j)
|
|
|
{
|
|
|
if (i < 0) i = s.Length + i + 1;
|
|
|
- if (j < 0) i = s.Length + i + 1;
|
|
|
+ if (j < 0) j = s.Length + j + 1;
|
|
|
|
|
|
if (i < 1) i = 1;
|
|
|
if (j > s.Length) j = s.Length;
|
|
|
|
|
|
- return i > j ? "" : s.AsSpan().Slice(i - 1, j - 1);
|
|
|
+ return i > j ? "" : s.AsSpan()[(i - 1)..j];
|
|
|
}
|
|
|
}
|