//vstr:需要解析字符串,count:位置编号,sign:分隔符
//如果需要解析的字符串不包含中文unicode编码,将字符类型全部替换为string;
解析 xx|xxxx|xxxxx|xxxxx| 此种类型的字符串
function getpart(vstr: WideString; count: Integer; sign: WideString): WideString;
var i,j:Integer ;s:WideString;
begin
Result:='' ;
if count=0 then Result :=''
else
begin
for i:=0 to count-1 do
begin
j:=Pos(sign,vstr);
if j=0 then
begin
s:='';
break;
end
else
begin
s:=LeftStr(vstr,j-1);
vstr:=rightstr(vstr,Length(vstr)-length(s)-length(sign));
end;
end;
result:=s;
end;
end;