Possible Duplicate:
ASCIIEncoding In Windows Phone 7
I am working with Windows Phone 8, and I have noticed that Encoding.ASCII doesn't exist in .NET for Windows Phone, but there is a class called ASCIITools, which contains a method called StringToAscii. which returns a byte array and accepts a string.
I ask because I am trying to convert some code which initially gets a character array from a string like this:
char[] myCharArray = blah.Substring(aaa, bbb).ToCharArray();
And then gets the byte array from the char array by passing it into the GetBytes method:
byte[] blah = Encoding.ASCII.GetBytes(myCharArray, 0, myCharArray.Length);
It looks like this class will allow me to go directly from a string to a byte array like so:
byte[] blah = ASCIITools.StringToAscii(blah.Substring(aaa, bbb));
Will this work?