本文整理匯總了VB.NET中System.Text.UTF7Encoding.GetString方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET UTF7Encoding.GetString方法的具體用法?VB.NET UTF7Encoding.GetString怎麽用?VB.NET UTF7Encoding.GetString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Text.UTF7Encoding
的用法示例。
在下文中一共展示了UTF7Encoding.GetString方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: SamplesUTF7Encoding
' 導入命名空間
Imports System.Text
Public Class SamplesUTF7Encoding
Public Shared Sub Main()
' Create an instance of UTF7Encoding.
Dim u7 As New UTF7Encoding(True)
' Create byte arrays from the same string containing the following characters:
' Latin Small Letter Z (U+007A)
' Latin Small Letter A (U+0061)
' Combining Breve (U+0306)
' Latin Small Letter AE With Acute (U+01FD)
' Greek Small Letter Beta (U+03B2)
Dim myStr As String = "za" & ChrW(&H0306) & ChrW(&H01FD) & ChrW(&H03B2)
' Encode the string.
Dim myBArr(u7.GetByteCount(myStr)) As Byte
u7.GetBytes(myStr, 0, myStr.Length, myBArr, 0)
' Decode the byte array.
Console.WriteLine("The new string is: {0}", u7.GetString(myBArr, 0, myBArr.Length))
End Sub
End Class
'This code produces the following output. The question marks take the place of characters that cannot be displayed at the console.
'
'The new string is: za??ß