本文整理汇总了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??ß