public static byte[] StringToBytes(string textInput) { if (string.IsNullOrEmpty(textInput)) { return(null); } List <byte> bytes = new List <byte>(); for (int i = 0; i < textInput.Length; i++) { bytes.Add(CharUtils.CharToByte(textInput[i])); } return(bytes.ToArray()); }
public static byte StringToByte(string input) { return(CharUtils.CharToByte(input[0])); }