展开全部
您好,
代码如下:
Private Sub cmdConvert_Click()
Dim varBefore, varAscii
Dim strBefore As String
Dim strAfter As String
Const CharacterSeparator As String = "/"
strBefore = Trim$(txtBefore.Text)
If strBefore <> vbNullString Then
If strBefore Like "*" & CharacterSeparator & "*" Then
varBefore = Split(strBefore, CharacterSeparator)
For Each varAscii In varBefore
If varAscii <> vbNullString Then
If IsNumeric(varAscii) Then
strAfter = strAfter & Chr$(varAscii)
End If
End If
Next
txtAfter.Text = strAfter
End If
End If
End Sub
运行效果:
展开全部
Private Sub Command1_Click()
Dim a As Variant
a = Split(Text1, "/")
For i = 0 To UBound(a)
Print Chr(Val(a(i))),
Next
End Sub
Dim a As Variant
a = Split(Text1, "/")
For i = 0 To UBound(a)
Print Chr(Val(a(i))),
Next
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Command1_Click()
Dim k() As String
If Text1.Text <> "" Then
k = Split(Text1.Text, "/")
If UBound(k) >= 0 Then
Text1.Text = ""
For i = 0 To UBound(k)
If Check1.Value Then
Text1.Text = Text1.Text & Chr(Val("&H" & Trim(k(i))))
Else
If IsNumeric(k(i)) Then Text1.Text = Text1.Text & Chr(Val(k(i)))
End If
Next i
End If
End If
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询