16,748
社区成员
发帖
与我相关
我的任务
分享
var
i:Integer;
list: TStringList;
s,sp:string;
begin
list := TStringList.Create;
sp := ',';
s := '1111111111112354611111111111654841111111111111111';
for i := Length(s) downto 1 do
begin
if i = 1 then Break;
if ((s[i] = '1') and (s[i-1] <> '1')) or ((s[i] <> '1') and (s[i-1] = '1')) then
begin
Insert(sp,s,i);
end;
end;
list.CommaText := s;
ShowMessage(list.Text);
list.Free;
end;