delphi ,号 分离内容问题 我现在有 这样的字符串s:string;s:=a,b,c如何能分离出 a b c 这 就是 把这个s的字符串 中间的2个 ‘,’分离出 3个部分来 求解 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://zsqztg.blog.51cto.com/601880/171122 function TForm1.separate(ASubStr, ACompleteStr: string): TStrings;var _index :Integer; _TempStr :string;begin Result := TStringList.Create; if ACompleteStr <>'' then begin _index := Pos(ASubStr, ACompleteStr); while _index > 0 do begin _TempStr := Copy(ACompleteStr, 1, _index - 1); Result.Add(_TempStr); ACompleteStr := Copy(ACompleteStr, _index + 1, Length(ACompleteStr) - _index); _index := Pos(ASubStr, ACompleteStr); if (_index <= 0) and (ACompleteStr <> '') then //最后一个串 Result.Add(ACompleteStr); end; end;end;调用:procedure TForm1.Button1Click(Sender: TObject);begin Memo1.Text := separate(';', edit1.text).Text;end;实际调用:separate(';', abc;123;iku)显示:abc123iku 一个等待窗本的显示问题! 如何控制死循环不卡进程 我想编个获取系统所有进程和获取与进程相关窗口标题的代码,给位大侠能给个帮助吗?(delphi) 散分纪念阿日离开 好久没来了,放分200 高手请进,这个字符表达式是不是不对啊? 怎么算天数? 新手问题,我取得注册表的root串,怎样把它转化为相应的HKEY_CURRENT_CONFIG这样的东西. 网上哪里有关于midas的例子?谢谢 各位朋友请帮忙:我建立的动态数组,在使用时没问题,整个程序退出时,为什么出错? Memo中获得鼠标选中的字符串 窗体创建问题,经典老难题?
var
_index :Integer;
_TempStr :string;
begin
Result := TStringList.Create;
if ACompleteStr <>'' then
begin
_index := Pos(ASubStr, ACompleteStr);
while _index > 0 do
begin
_TempStr := Copy(ACompleteStr, 1, _index - 1);
Result.Add(_TempStr);
ACompleteStr := Copy(ACompleteStr, _index + 1, Length(ACompleteStr) - _index);
_index := Pos(ASubStr, ACompleteStr);
if (_index <= 0) and (ACompleteStr <> '') then //最后一个串
Result.Add(ACompleteStr);
end;
end;
end;调用:
procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.Text := separate(';', edit1.text).Text;
end;实际调用:
separate(';', abc;123;iku)
显示:
abc
123
iku