split函数

type 
userarray=array of string;

function split(s:string;dot:char):userarray; 
var 
str:userarray; 
i,j:integer; 
begin 
i:=1; 
j:=0; 
SetLength(str, 255); 
while Pos(dot, s) > 0 do //Pos返回子串在父串中第一次出现的位置. 
begin 
str[j]:=copy(s,i,pos(dot,s)-i); 
i:=pos(dot,s)+1; 
s[i-1] := chr(ord(dot)+1); 
j:=j+1; 
end; 
str[j]:=copy(s,i,strlen(pchar(s))-i+1); 
result:=str; 
end; 

http://www.cnblogs.com/azhqiang/p/3963218.html

原文地址:https://www.cnblogs.com/findumars/p/7147668.html