获取邮箱中的用户名

有一个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 

 

 

 

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

posted @ 2010-02-19 22:23  Delcpp  阅读(501)  评论(0编辑  收藏  举报