字符串处理

数字字符串互转

Sub sample()
Dim a As String
a = 10
Debug.Print a

Dim b As Integer
b = CInt(a)
b = a + 1
Debug.Print b

End Sub

 

ASCII 和 字符互转

Sub sample()
Dim str As String
Dim ascCode As Integer
str = "A"

ascCode = Asc(str)
Debug.Print Asc(str)

str = Chr(ascCode + 1)
Debug.Print str

End Sub

 

posted @ 2022-02-12 18:01  今天起个早  阅读(26)  评论(0)    收藏  举报