What is the best way to embed binary value in String

68 Views Asked by At

I would like to use escape to represent control code to build a message with terminal color.

Can I use something like...

"\u001b[93m" or "\x1b[93m"

?

2

There are 2 best solutions below

0
On

Currently I am using this method:

val newargs = append-all([to-string(to-char(27)) CGREEN msg to-string(to-char(27)) CEND])

to-string(to-char(27)) is too clumsy. I am sure there is a better method.

2
On

You can see how this library implements terminal colors as a reference