如何判断输入的字符串是电子邮件地址

None.gif Function IsEMail(EMail: String): Boolean;
None.gifvar
None.gif    s: String;
None.gif    ETpos: Integer;
None.gifbegin
None.gif    ETpos:
=  pos( ' @ ' , EMail);  // 获取@符号的位置
None.gif
     if  ETpos  >   1  then 
None.gif    begin 
None.gif        s:
=  copy(EMail,ETpos + 1 ,Length(EMail));  // 截取子串
None.gif
         if  (pos( ' . ' , s)  >   1 ) and (pos( ' . ' , s)  <  length(s)) then 
None.gif            Result:
=   true
None.gif        
else  
None.gif            Result:
=   false
None.gif        end
None.gif    
else  
None.gif        Result:
=   false
None.gifend;

转载于:https://www.cnblogs.com/sonicit/archive/2007/07/09/811692.html

你可能感兴趣的:(如何判断输入的字符串是电子邮件地址)