自己解决了不过还是谢谢各位!
function cutstring(var str : String;
num:integer) : String;
var i:integer;
begin
i:=1;
if length(str)>0 then
begin
while (i <= num ) do
begin
if (Ord(str)>=129) and (Ord(str[i+1])>=64 ) then
begin
if(i>=num-2) then
begin
Result :=copy(str,1,i+1);
Delete(s,1,i+1);
break;
end;
Inc(i, 2);
end
else
begin
if str=chr(13) then
begin
Result :=copy(str,1,i);
Delete(s,1,i);
break;
end;
if(i=num) then
begin
Result :=copy(str,1,i-1);
Delete(s,1,i-1);
break;
end;
inc(i);
end;
end;
end
else
Result :='';
end;