通过vb怎样提取文本中的qq号?

2024-12-02 18:28:05
推荐回答(4个)
回答1:

TAB键是QQ名中不可能出现的,以此为分隔符进行分割。
如果“亲亲√Z行者”为“1 亲亲√Z行者”,以上算法皆枉然,以下为通用算法:
Private Sub Command1_Click()
arr = Split(Text1, vbCrLf)
For i = 0 To UBound(arr)
arr(i) = Trim(Split(arr(i) & vbTab, vbTab)(1)) & "@qq.com"
Next
Text2 = Join(arr, vbCrLf)
End Sub

回答2:

Private Sub Command1_Click()
Dim R, S As String, I As Integer
S = Text1.Text
S = Replace(S, " ", ",")
R = Split(S, ",")
S = ""
For I = LBound(R) To UBound(R)
If IsNumeric(R(I)) Then S = S + R(I) + vbCrLf
Next I
Text2.Text = Left(S, Len(S) - 1)
End Sub

回答3:

Private Sub Command1_Click()
R = Split(Replace(Text1.Text, " ", ","), ",")
For I = LBound(R) To UBound(R)
If IsNumeric(R(I)) Then Text2.Text = Text2.Text & Replace(Replace(R(I), vbTab, ""), " ", "") & "@qq.com" & vbCrLf
Next I
End Sub

回答4:

滴答滴滴答滴为什么小花男朋友叫她太主她会生气...