//--------------------------------------------------------------------------------
// 功能:将指定分隔符分隔的字符串转换为字符串列表。
// 此函数在需要将
// 参数:
// pcString : string; 字符串
// pcChar : string; 分隔符
// pDesList : TStringList 字符串列表
// 例如:
// var tmpFldList : TStrings ;
// begin
// tmpFldList := TStringList.Create ;
// StrToStringList( Uppercase(pcFields), ',' , tmpFldList );
// ......
// tmpFldList.Free ;
// end;
//--------------------------------------------------------------------------------
Procedure StrToStringList( pcString,pcChar:string; pDesList : TStringList ) ; overload ;
var cAddStr,cSrcStr : string ;
nPos : integer ;
begin
pDesList.Clear ;
cSrcStr := pcString ;
while True do
begin
nPos := pos( pcChar, cSrcStr );
if nPos = 0 then begin
pDesList.Add( cSrcStr ) ;
Exit ;
end
else begin
cAddStr := copy( cSrcStr,1, nPos - 1 );
pDesList.Add( cAddStr ) ;
Delete( cSrcStr,1, nPos + length( pcChar )-1 );
end;
end;
end;