VB.NET 字符串转Unicode十进制编码源码

VB.NET · 2023-05-26 · 499 人浏览

运行图

2023-05-26_11-49-27.png

源码

Sub Main(args As String())
跳过:
Console.Clear()
Dim inputString As String
Console.WriteLine("请输入字符串:")
inputString = Console.ReadLine()
Dim unicodeArray(inputString.Length - 1) As Integer

    For i As Integer = 0 To inputString.Length - 1
        unicodeArray(i) = Char.ConvertToUtf32(inputString, i)
    Next

    Console.Write("输出的十进制Unicode编码为:" & Environment.NewLine)
    For Each code As Integer In unicodeArray
        Console.Write("&#" & code.ToString() & "; ")
    Next
    Console.ReadLine()
    GoTo 跳过
End Sub
VB.NET
* 人工审核评论,通过后即可正常显示。软件建议请添加微信