Highlight specific words

I would like to highlight specific words within a sentence while I’m scanning content. Is there a way to find the location of a word within a sentence so that I can highlight it? I don’t want to highlight the entire text fragment just a subset.

@mjanulaitis

Thank you for contacting support.

You may search for any text and iterate through words as well as characters and then highlight text as per your requirements as explained in the other thread created by you. Where, you may use below code to iterate through any subset of text.

foreach (TextFragment textFragment in textFragmentCollection1)
{
    foreach (TextSegment textSegment in textFragment.Segments)
    {
        foreach (CharInfo charInfo in textSegment.Characters)
        {
            //TODO Code Here
        }
    }
}

We hope this will be helpful. Please feel free to contact us if you need any further assistance.

Thanks I was able to get that to work.