获取邮箱中的用户名
有一个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
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
没事,别怕,这是签名→→┃ 青山幽谷笛声扬,白鹤振羽任翱翔。往事前尘随风逝,携手云峰隐仙乡。 ┃