vb编程 编写一个对输入字符进行转换的程序。转换规则为,将其中的大写字母转换成小写字母,小写字母转换

2024-11-28 10:05:29
推荐回答(1个)
回答1:

Private Sub Form_Load()
Me.AutoRedraw = True
a = InputBox("")
For i = 1 To Len(a)
b = Mid(a, i, 1)
If Not (IsNumeric(b)) Then
If UCase(b) = b Then
s = "%B" & s
Else
s = UCase(b) & s
End If
Else
s = b & s
End If
Next i
Print s
Print "字符串的长度 " & Len(s)
End Sub