繁体中文
设为首页
加入收藏
当前位置:技术首页 >> 开发 >> Delphi >> Delphi中优秀的字符串分割函数

Delphi中优秀的字符串分割函数

2006-10-11 17:26:14  作者:admin  来源:赛迪网  浏览次数:210  文字大小:【】【】【
关键字:Delphi

DELPHI没有自己的字符串分割函数,所以只能程序员自己写了,网上搜了好多但是真正好用的没有几个,

下面这个是我在网上找到修改后了的,个人感觉算法不错,所以就贴了上来。

 

function SplitString(Source, Deli: string ): TStringList;stdcall; 

var 

EndOfCurrentString: byte; 

StringList:TStringList; 

begin 

StringList:=TStringList.Create; 

while Pos(Deli, Source)>0 do 

begin 

EndOfCurrentString := Pos(Deli, Source); 

StringList.add(Copy(Source, 1, EndOfCurrentString - 1)); 

Source := Copy(Source, EndOfCurrentString + length(Deli), length(Source) - EndOfCurrentString); 

end; 

Result := StringList; 

StringList.Add(source); 

end;

点击收藏到

责任编辑:admin

本文引用地址: http://tech.itzero.com/2006/1011/848.html 请粘贴到你的QQ/MSN上推荐给你的好友

相关文章
Delphi使用VB编写的ActiveX控件全攻略
在delphi.net的VCL.net里使用Ado.net
用Delphi开发Web服务数据库程序
Delphi程序实现对光驱盘盒的开关控制
Delphi中动态链接库(DLL)的建立和使用
在delphi.net的VCL.net里使用Ado.net
在Delphi中如何维护COM+的状态信息
用Delphi编写VxD设备驱动程序
Delphi使用VB编写的ActiveX控件全攻略
在delphi中使用xml文档的两种方法
 

最新文章

更多

· Delphi使用VB编写的Acti...
· 在delphi.net的VCL.net里...
· 用Delphi开发Web服务数据...
· Delphi程序实现对光驱盘...
· Delphi中动态链接库(DLL...
· 在delphi.net的VCL.net里...
· Delphi中优秀的字符串分...
· 在Delphi中如何维护COM+...
· 用Delphi编写VxD设备驱动...
· Delphi使用VB编写的Acti...

热点文章

更多

其它推荐