Embed mIRC Color codes into a C# literal?

FlySwat picture FlySwat · Sep 8, 2009 · Viewed 13.6k times · Source

I'm working on a simple irc bot in C#, and I can't figure out how to embed the typical mirc control codes for bold/color etc into string literals.

Can someone point me towards how to do this?

Answer

dtb picture dtb · Sep 8, 2009

The mIRC color code format is described here. I guess you're asking how to embed a ^C in a string.

This is known as Caret notation. According to C0 and C1 control codes, ^C is:

'\x03'

Embedded in a string:

"blabla \x035,12to be colored text and background\x03 blabla"