function Explode(const source, ch: string): TResultArray;
var
temp: string;
i: integer;
begin
temp := source;
i := pos(ch, source);
while i <> 0 do
begin
SetLength(Result, Length(Result) + 1);
Result[Length(Result) - 1] := copy(temp, 0, i - 1);
delete(temp, 1, i);
i := pos(ch, temp);
end;
SetLength(Result, Length(Result) + 1);
Result[Length(Result) - 1] := Temp;
end;
类似于PHP中的Explode函数,用于把一个按照特定字符分割的字符串分开
var
temp: string;
i: integer;
begin
temp := source;
i := pos(ch, source);
while i <> 0 do
begin
SetLength(Result, Length(Result) + 1);
Result[Length(Result) - 1] := copy(temp, 0, i - 1);
delete(temp, 1, i);
i := pos(ch, temp);
end;
SetLength(Result, Length(Result) + 1);
Result[Length(Result) - 1] := Temp;
end;
类似于PHP中的Explode函数,用于把一个按照特定字符分割的字符串分开
解决方案 »
- DELPHI程序如何实现与游戏中的NPC对话
- 如何用Delphi来现软件测试中的一致性检验.
- 如何仅显示前10条记录
- 前端如何捕获后台存储过程定义的错误?
- 高分求救!!!!关于QuickReport的问题????、
- WIN2000下打印quickrep自定义纸张打印问题(LK1600KIII+打印小票据)
- 3层结构中 应用服务器的窗体部分如何能用到远程数据模块中的过程和方法?
- unit2.unit3上的adoquery都可以使用这个adoconnection,但编译的时候却不通过请问你门知道是什么原因吗
- 程序打包及调用exe文件?
- 关于用DBGridEh,MemTableEh组件显示树时展开节点的事件
- 在用Printer象打印的时候,怎么样能减小行距?急
- 报表打印程序:DBGRID,LISTVIEW,STRINGGRID的打印
use TResultArray = array of string;
如何实现?谢谢
procedure a(var i:string);
SetLength(Result, Length(Result) + 1),
result是数组好象不对。