本文整理自网络,侵删。
有一个E-mail地址:username@***.com,编一个程序,读出username.
{------------------------------------------------------}
{ 从 ****@###.##中提取出**** }{------------------------------------------------------}function GetUserName(EmailAddress:string):string;var EdPosition : Integer;begin EdPosition := AnsiPos('@',EmailAddress); if EdPosition >0 then begin result :=Copy(EmailAddress,0,EdPosition-1); end else Result := EmailAddress;end;
相关阅读 >>
Delphi的datetostr strtodate格式灵活用法
Delphi winapi: shellexecute - 打开外部程序或文件
更多相关阅读请进入《Delphi》频道 >>