The Original String :
$strOriginal = "Console.WriteLine(\"This is a private test with stringbuilder\");"
The Keywords :
private, string
The Formatted String :
$strFormatted = "Console.WriteLine(<font color="gray">\"This is a private test with stringbuilder\"</font>);"
The Wrong Formatted String :
$strFormatted = "Console.WriteLine(<font color="gray">\"This is a <font color="blue">private</font> test with <font color="blue">string</font>builder\"</font>);"
A keyword would be blue. But if it is quoted, then it will still be gray. Also, the "stringbuilder" should be gray. Actually I have no idea to do that. Does anybody have a solution?
I do the formatting with double quotes first, because the <font> tag also contains a pair of double quotes.