String的成員函數(shù)中就有 ToUpper() 和 ToLower()啊
專業(yè)領(lǐng)域包括做網(wǎng)站、網(wǎng)站建設(shè)、商城網(wǎng)站制作、微信營(yíng)銷、系統(tǒng)平臺(tái)開(kāi)發(fā), 與其他網(wǎng)站設(shè)計(jì)及系統(tǒng)開(kāi)發(fā)公司不同,創(chuàng)新互聯(lián)公司的整合解決方案結(jié)合了幫做網(wǎng)絡(luò)品牌建設(shè)經(jīng)驗(yàn)和互聯(lián)網(wǎng)整合營(yíng)銷的理念,并將策略和執(zhí)行緊密結(jié)合,為客戶提供全網(wǎng)互聯(lián)網(wǎng)整合方案。
Dim a As String = "abcEd"
Dim b As String = a.ToUpper() //大寫
Dim c As String = a.ToLower() //小寫
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
可以試著用典型的VB字符串函數(shù)UCase解決。
比如先把輸入的內(nèi)容放到字符串A$中,若A$="a",則經(jīng)
A$=UCase(A$)轉(zhuǎn)換后,結(jié)果即是A$="A"。
我在程序中是這麼處理的。行不行,試試就知道了。