分割字符串,将其存入StringList
strlist := TStringList.Create;
s:=Memo1.Text;
for i:=1 to length(s) do
begin
nPos:=Pos('____',s);
if nPos>0 then
begin
strlist.Add(Copy(s,1,nPos-1));
s:=copy(s,nPos+4,length(s)-nPos);
end
else if (nPos=0) and (i>1) then
begin
strlist.Add(S);
break;
end;
end;
for i:=0 to strlist.Count-1 do
showmessage(strlist.Strings[i]);
------------------------------------
体验速度,体验CSDN新版论坛助手:http://community.csdn.net/Expert/TopicView.asp?id=3108679