Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
Imports System
Imports System.Text
Class UnicodeEncodingExample
Public Shared Sub Main()
Dim bytes() As Byte = {115, 0, 99, 0, 101, 0, 100, 0, 101, 0}
Dim uni As New UnicodeEncoding()
Dim charCount As Integer = uni.GetCharCount(bytes, 2, 8)
Console.WriteLine("{0} characters needed to decode bytes.", charCount)
End Sub
End Class
Related examples in the same category