delphi 中的split 函数


本文整理自网络,侵删。

 delphi 中的 split 函数 类似于 vb中的 split函数

type 
userarray=array of string;

function split(s:string;dot:char):userarray; 
var 
str:userarray; 
i,j:integer; 
begin 
i:=1; 
j:=0; 
SetLength(str, 255); 
while Pos(dot, s) > 0 do //Pos返回子串在父串中第一次出现的位置. 
begin 
str[j]:=copy(s,i,pos(dot,s)-i); 
i:=pos(dot,s)+1; 
s[i-1] := chr(ord(dot)+1); 
j:=j+1; 
end; 
str[j]:=copy(s,i,strlen(pchar(s))-i+1); 
result:=str; 
end; 

相关阅读 >>

Delphi 10中实现android的广播接收器

Delphi中读写txt文件的一段代码

Delphi 取pe文件的引入表和导出表

Delphi实现qq右下角弹出信息窗口

Delphi firemonkey中listboxaccessory图标切换

Delphi 在减少占用资源的情况下,等待msecs毫秒

Delphi 使用并行库中的ttask

Delphi idhttp post中文的问题

Delphi编辑环境

Delphi for 循环的例子 多种用法

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...