How to Convert a String to Byte Array in C#?

Below is a sample code snippet demonstrating the conversion of string to Byte Array in C#.

How to Convert a String to Byte Array in C#?

namespace AbundantCode

{

internal class Program

{

//How to Implement Multiple order by in LINQ using C# ?

private static void Main(string[] args)

{

string Input = "Welcome to Abundantcode.com";

Byte[] ByteOutput = ConvertStringToByte(Input);

}

public static byte[] ConvertStringToByte(string Input)

{

return System.Text.Encoding.UTF8.GetBytes(Input);

}

}

}