s = "中国 123456" MsgBox GetValue(s) End SubPublic Function GetValue(aStrParam As String) As String Dim i As Long, strTmp As String
For i = 1 To Len(aStrParam) If Asc(Mid(aStrParam, i, 1)) > 0 Then GetValue = Trim(Mid(aStrParam, i)) Exit Function End If Next End Function
Private Sub Command1_Click() Dim s As String
s = "中国 123456" MsgBox GetValue(s) End SubPublic Function GetValue(aStrParam As String) As String GetValue = StrReverse(Val(StrReverse(aStrParam))) End Function
aa="123456"
select * from 表 where 字段='" & aa & "%'
第一行用x=mid("中国 123456",7,6),
第二行用x=mid("中国人 123456",6,6),
第三行用x=mid("中国人民123456",5,6),
可不可以用相同的一句
Dim s As String
s = "中国 123456"
MsgBox GetValue(s)
End SubPublic Function GetValue(aStrParam As String) As String
Dim i As Long, strTmp As String
For i = 1 To Len(aStrParam)
If Asc(Mid(aStrParam, i, 1)) > 0 Then
GetValue = Trim(Mid(aStrParam, i))
Exit Function
End If
Next
End Function
Dim s As String
s = "中国 123456"
MsgBox GetValue(s)
End SubPublic Function GetValue(aStrParam As String) As String
GetValue = StrReverse(Val(StrReverse(aStrParam)))
End Function