var textRangeAll = search.FindAll("\\[");
foreach (var textRange in textRangeAll)
{
if (textRange != null)
{
DocumentPosition startB = textRange.StartPosition;
DocumentPosition endB = textRange.EndPosition;
var spaceRange = search.Find("[ ;.,]", startB);
…
}
}
The code above will find all open brackets in a rich text box and loop through them. In the loop we then find the next space, semicolon, period or comma starting in the position of the open bracket.
I need to change this to start the find for [ ;.,] two characters AFTER the open bracket. In other words I need to change startB DocumentPosition variable to two characters after the open bracket.
How can I do this?