26 public override async Task<List<(int, int)>>
Split(
string input)
28 List<(int, int)> indices =
new List<(
int,
int)>();
29 await Task.Run(() => {
31 bool seenChar =
false;
32 for (
int i = 0; i < input.Length; i++)
34 bool isDelimiter =
delimiters.Contains(input[i]);
37 while ((i < input.Length - 1) && (
delimiters.Contains(input[i + 1]) ||
char.IsWhiteSpace(input[i + 1]))) i++;
41 if (!seenChar) seenChar = !
char.IsWhiteSpace(input[i]);
43 if ((i == input.Length - 1) || (isDelimiter && seenChar))
45 indices.Add((startIndex, i));