本文整理自网络,侵删。
function PosCh(ch: Char; const S: String): Integer;var I: Integer;begin for I:=1 to Length(S) do if S[I] = ch then begin result := I; Exit; end; result := 0;end;
function ExtractOwner(const S: String): String;var P: Integer;begin result := ''; P := PosCh('@', S); if P > 0 then result := Copy(S, 1, P - 1);end;
procedure TForm1.FormCreate(Sender: TObject);beginshowmessage(ExtractOwner('abc123@163.com'));end;
相关阅读 >>
Delphi xe6 使用intent启动活动并在android应用程序中获取返回值的示例
Delphi获取flash文件的影片时长,原始尺寸,帧数等信息
Delphi superobject json操作类的基本用法
更多相关阅读请进入《Delphi》频道 >>