如何做到篩選text1文本框中輸入的字母字符,并反序在text 2中存放?
uj5u.com熱心網友回復:
Dim i As Long
Dim strtmp As String
For i = 1 To Len(Text1.Text)
If Mid(Text1.Text, i, 1) > "A" Then '這個篩選條件自己去寫
strtmp = Mid(Text1.Text, i, 1) & strtmp '反序
End If
Next
Text2.Text = strtmp
uj5u.com熱心網友回復:
除了正常比較,也可以用正則運算式:
dim reg
set reg = createobject("vbscript.regexp")
reg.global = true
reg.ignorecase = true
reg.multiline = false
reg.pattern = "[a-zA-Z]"
dim colMatches
set colMatches = reg.execute(Text1)
dim strTemp
strTemp = ""
dim objMatch
for each objMatch in colMatches
strTemp = objMatch.value & strTemp
next
Text2 = strTemp
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/36962.html
標籤:VB基礎類
上一篇:請教有關JSON 中物件陣列處理
下一篇:尋求幫助
