I am using the following code to find each line that starts with "@" and format it by making it bold:
foreach (var line in tweetText.Document.Blocks)
{
var text = new TextRange(line.ContentStart,
line.ContentEnd).Text;
line.FontWeight = text.StartsWith("@") ?
FontWeights.Bold : FontWeights.Normal;
}
However, I would like to use the code to find each word instead of line beginning with "@" so I could format a paragraph like:
Blah blah blah @username blah blah blah blah @anotherusername
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…