This article describes a simple implementation method for C# to convert strings into byte arrays. Share it for your reference. The specific implementation method is as follows:
using ; public static byte[] ConvertStringToByteArray(string stringToConvert) { return (new UnicodeEncoding()).GetBytes(stringToConvert); }
I hope this article will be helpful to everyone's C# programming.