MarkovText.Markov.buildKey C# (CSharp) Method

buildKey() private method

private buildKey ( int startIndex ) : string
startIndex int
return string
        private string buildKey(int startIndex)
        {
            StringBuilder sb = new StringBuilder();
            //Append the initial word out of the loop to avoid appending an extra space
            sb.Append(words[startIndex]);
            for (int i = startIndex + 1; i < (startIndex + k); i++)
            {
                sb.Append(" ");
                sb.Append(words[i]);
            }
            return sb.ToString();
        }