title: Problem with finding the next word in RichTextBox
body: <p>As I enter a character in my RichTextBox, I want to get the next character from the its TextRange. </p>
  
  <p>So here is how I do it:</p>
  
  <pre><code>TextPointer ptr1= RichTextBox.CaretPosition;
  char nextChar = GetNextChar();
  //we continue until there is a character
  while (char.IsWhiteSpace(nextChar))
  {
     ptr1= ptr1.GetNextInsertionPosition(LogicalDirection.Forward);
     nextChar = GetCharacterAt(Ptr1);
  }
  //so now ptr1 is pointing to a character, and we do something with that TextPointer
  ChangeFormat(ptr1);
  </code></pre>
  
  <p>then I get the ptr1 of the next character and from the TextPointer, I get the TextRange, and do my changes.</p>
  
  <p><strong>So here is the problem?</strong></p>
  
  <p>when the next word is spelled correctly, I have no problem, but <strong>if it's not spelled properly</strong> then ptr1 would not point to the first character of the next word (the second character), and if I use GetNextContextPosition(LogicalDirection.Forward) it would give me the first letter of the next word if it's misspelled. So depending on the spelling only one of them works? </p>
  
  <p>I was just wondering if you have any idea about this problem? Is there anything wrong I am doing here? </p>