private int GetTailIndex(int tailIndex, string str) { int retIndex = tailIndex + KeyWordRange; return Math.Min(str.Length - 1 , retIndex); }