public int[] GetWord(int startIdx, int idx)
{
int last = idx;
int first = idx;
// forward
for (; last < totalTextLength; ++last) {
if (!char.IsLetter(text[last]))
break;
}
if (last == idx)
return null;
// backward
for (; first >= startIdx; --first) {
if (!char.IsLetter(text[first]))
break;
}
++first;
return new int[]{first, last};
}