It rather depends on the nature of the serial port data format. If the data consists of mostly ASCII text characters interspersed with the occasional control character, then you can embed them in the string, e.g.
var data1 = Encoding.ASCII.GetBytes("Foo\x1CBar\x1CBaz");
However, if the data consists of several fields of various data types, then the BitConverter
class may be more useful, e.g.
var data2 = new List<byte>();
// Add an int value
data2.AddRange(BitConverter.GetBytes(6));
// Add a control character
data2.Add(0x1C);
// Add an ASCII-encoded string value
data2.AddRange(Encoding.ASCII.GetBytes("Hello"));
As others have pointed out, ASCII is not the only string encoding you could use, but from a serial port it is the most likely.