CSharp examples for System:Byte Array
Converts a string to an array of bytes
public class Main{ /// <summary> /// Converts a string to an array of bytes /// </summary> /// <param name="sourceString">The string to be converted</param> /// <returns>The new array of bytes</returns> public static byte[] ToByteArray(System.String sourceString) {// www . ja v a2 s . c o m return System.Text.UTF8Encoding.UTF8.GetBytes(sourceString); } }