现在的位置: 首页 > 综合 > 正文

获取邮箱中的用户名

2012年03月29日 ⁄ 综合 ⁄ 共 534字 ⁄ 字号 评论关闭

有一个E-mail地址:username@***.com,编一个程序,读出username.

 

 1 {------------------------------------------------------}
 2 {               从 ****@###.##中提取出****              }
 3 {------------------------------------------------------}
 4 function GetUserName(EmailAddress:string):string;
 5 var
 6   EdPosition : Integer;
 7 begin
 8   EdPosition := AnsiPos('@',EmailAddress);
 9   if EdPosition >0 then
10     begin
11       result :=Copy(EmailAddress,0,EdPosition-1);
12     end
13   else
14     Result := EmailAddress;
15 end;
16 

 

 

 

 {☆推荐☆:返利网,网上购物拿返利,省钱新门道}

抱歉!评论已关闭.