vb.net大小写字母转换
答案:3 悬赏:40 手机版
解决时间 2021-03-07 05:56
- 提问者网友:我一贱你就笑
- 2021-03-06 05:05
我定义了一个变量,是STRING,如:0gf0ajkh04624v,是小写字母和数字混合组成的,如何使其中的小写字母转换成大写字母?
最佳答案
- 五星知识达人网友:痴妹与他
- 2021-03-06 06:15
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Dim s As String = "0Ff0ajkh04624F"
Dim i As Integer = 0
Dim sTemp As String = ""
Dim ss As String = ""
For i = 1 To Strings.Len(s)
sTemp = Mid(s, i, 1)
If Asc(sTemp) >= 65 And Asc(sTemp) <= 90 Then
sTemp = LCase(sTemp)
ElseIf Asc(sTemp) >= 95 And Asc(sTemp) <= 122 Then
sTemp = UCase(sTemp)
Else
sTemp = sTemp
End If
ss = ss & sTemp
Next
MsgBox(ss)
End Sub
Dim s As String = "0Ff0ajkh04624F"
Dim i As Integer = 0
Dim sTemp As String = ""
Dim ss As String = ""
For i = 1 To Strings.Len(s)
sTemp = Mid(s, i, 1)
If Asc(sTemp) >= 65 And Asc(sTemp) <= 90 Then
sTemp = LCase(sTemp)
ElseIf Asc(sTemp) >= 95 And Asc(sTemp) <= 122 Then
sTemp = UCase(sTemp)
Else
sTemp = sTemp
End If
ss = ss & sTemp
Next
MsgBox(ss)
End Sub
全部回答
- 1楼网友:杯酒困英雄
- 2021-03-06 07:26
界面如图:
代码为 :
private sub command1_click() text4 = replace(text1, text2, text3,1) end sub
- 2楼网友:几近狂妄
- 2021-03-06 07:08
Dim str As String = "0gf0ajkh04624v"
MsgBox(str .ToUpper())
'ToUpper是把小写字母转换成大写
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯