Decodes a range of bytes from a byte array into a string. : ASCIIEncoding « Internationalization I18N « C# / C Sharp






Decodes a range of bytes from a byte array into a string.

 
using System;
using System.Text;

class ASCIIEncodingExample {
    public static void Main() {
        Byte[] bytes = new Byte[] {
             65,  83,  67,  73,  73,  32,  69,
            110,  99, 111, 100, 105, 110, 103,
             32,  69, 120,  97, 109, 112, 108, 101
        };

        ASCIIEncoding ascii = new ASCIIEncoding();
        String decoded = ascii.GetString(bytes);
        Console.WriteLine(decoded);
    }
}

   
  








Related examples in the same category

1.ASCIIEncoding Class represents an ASCII character encoding of Unicode characters.
2.Initializes a new instance of the ASCIIEncoding class.
3.Calculates the number of bytes produced by encoding
4.Calculates the number of bytes produced by encoding the characters in the specified String.
5.Encodes a set of characters from the specified character array into the specified byte array.
6.Encodes a set of characters from the specified String into the specified byte array.
7.Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
8.Decodes a sequence of bytes from the specified byte array into the specified character array.
9.Calculates the maximum number of bytes produced by encoding the specified number of characters.
10.Calculates the maximum number of characters produced by decoding the specified number of bytes.