The Encoding.GetBytes()
method converts a string into a bytes array.
The example below converts a string into a byte array in Ascii format
and prints the converted bytes to the console.
string author = "Katy McClachlen";
// converts a C# string to a byte array
byte[] bytes = Encoding.ASCII.GetBytes(author);
foreach (byte b in bytes)
{
Console.WriteLine(b);
}