procedure TForm1.Button4Click(Sender: TObject);
var a,b:string;
i:integer;
begin
a:='0:aa;1:bbl;2:cc';
b:='';
for i:=1 to length(a) do
begin
if (a[i]=':') or (a[i]=';') then
b:=b+#13#10
else
b:=b+a[i]; end;
showmessage(b);
end;
var a,b:string;
i:integer;
begin
a:='0:aa;1:bbl;2:cc';
b:='';
for i:=1 to length(a) do
begin
if (a[i]=':') or (a[i]=';') then
b:=b+#13#10
else
b:=b+a[i]; end;
showmessage(b);
end;
解决方案 »
- 如何设定调用的可执行文件的窗体位置,在线等待~~~
- 如何将条形码打印出来,并通过条形码图像识别(在线等,UP有分)
- 请教远程ACCESS数据库操作-----------很急,在线等待!!!!!
- 大家帮我看看错在哪里?
- 大家来帮忙!!!
- 线程切换的时候触发了什么事件?
- 简单问题大家答——如何统计树的某个节点下子节点的个数(100分)急!急!急!
- 请问:如何把应用程序的图标点击最小化时,放在WINDOWS桌面右下角的任务栏上,且双击后客恢复!!
- 控件cxComboBox 下拉值的显示问题
- 一个菜问题:在DELPHI下怎样模拟键盘击键呀?
- 我要一个如QQ的菜单控件(我的好友,坏名单,陌生人)等,或类似的
- 淡水河给分了
procedure TForm1.Button4Click(Sender: TObject);
var a,b:string;
i:integer;
begin
a:='0:aa;1:bbl;2:cc';
b:='';
for i:=1 to length(a) do
begin
if (a[i]=':') or (a[i]=';') then
memo1.lines.add(b);//假设你已加了memo1
b:='';
else
b:=b+a[i]; end;
if b<>'' then memo1.lines.add(b);
//showmessage(b);
end;
var
p: integer;
str_Tmp: string;
ss_Re: tstrings;begin
ss_re := tstringlist.Create;
str_tmp := concat(str_Source, str_compart);
try
repeat
begin
p := pos(str_Compart, str_tmp);
while p = 1 do //去掉左边的分隔符
begin
str_tmp := copy(str_tmp, 2, length(str_tmp) - 1);
p := pos(str_Compart, str_tmp);
end; if p < 0 then
if length(str_tmp) > 0 then //无分隔符时
begin
ss_re.add(str_tmp);
fun_getstritem := ss_re;
exit;
end;
ss_re.Add(copy(str_tmp, 1, p - 1));
str_tmp := copy(str_tmp, p + 1, length(str_tmp) - p);
end;
until (length(str_tmp) = 0);
fun_getstritem := ss_re;
except end;
end;