var
str: string;
i: integer;
begin
str := '101301,2101,23445.55';
memo1.Text := StringReplace(str, ',', #13#10, [rfReplaceAll]);
for i := 0 to memo1.Lines.Count-1 do
showmessage(memo1.Lines.Strings);
end;
// 得到分隔符中间的字段。N表示第几个分隔次,s为字符串,Letter为分割符.
function Chostr(S, Letter: string; N: integer): string;
var
i, j, sl: integer;
tmps: string;
begin
sl := length(s);
j := 0;
tmps := '';
n := n - 1;
for i := 1 to sl do
begin
if j = n then
if s <> Letter then
tmps := tmps + s
else
break;
if s = Letter then
inc(j);
end;
result := tmps;
end;
procedure TForm1.Button4Click(Sender: TObject);
var
s:string;
ss:TStrings;
f:array of Real;
i:integer;
begin
s:='101301,2101,23445.55';
ss:=TStringList.create;
ss.CommaText:=s;
setLength(f,ss.count);
for i:=0 to ss.count-1 do
try
f:=strtofloat(ss);
except
f:=0;
end;
for i:=0 to high(f) do showmessage(floattostr(f));
setlength(f,0);
ss.free;
end;