字符串解析

function TfrmTest.ParseDssFilesName(const strParam: string; strSplit: string): TStringList;
var
  tmpDssFileName: string;
  i: integer;
begin
  Result := TStringList.Create;

  if strParam = '' then
  begin
    exit;
  end;

  tmpDssFileName := strParam;

  i := pos(strSplit, strParam);
  while i <> 0 do
  begin
    Result.add(copy(tmpDssFileName, 0, i - 1));
    Delete(tmpDssFileName, 1, i);
    i:=pos(' ', tmpDssFileName);
  end;
  Result.add(tmpDssFileName);
end;

你可能感兴趣的:(字符串)