本文介绍了从可变长度的字符串中提取电子邮件地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从字符串中提取电子邮件地址?
How do I extract an email address from a string?
xxx [email protected] yyy
xxx 和 yyy 可以是任意长度、任意字符.电子邮件地址以空格分隔.
xxx and yyy can be any length, any character. The email address is delimited by spaces.
推荐答案
一种可能性:
sString = "[email protected] xxx [email protected] yyy [email protected]"
asString = Split(sString, " ")
For i = 0 To UBound(asString)
If asString(i) Like "*@*.*" Then
sEmail = sEmail & "," & asString(i)
End If
Next
MsgBox Mid(sEmail, 2)
这篇关于从可变长度的字符串中提取电子邮件地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!