TStringList类的字符分割有问题,另贴一替代函数
来源:互联网 发布:淘宝刚开始怎么做 编辑:程序博客网 时间:2024/05/18 16:17
TStringList类的字符分割有问题,当字符串中有#0到空格之间的任一字符时,都会被当作分割符,郁闷,另贴一替代函数:
function SplitString(Source, Deli: string ): TStringList;
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;
function SplitString(Source, Deli: string ): TStringList;
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;
- TStringList类的字符分割有问题,另贴一替代函数
- Delphi7 中TStringList的Delimiter DelimitedText有BUG,字符串分割有问题
- TStringList 的分割符如何支持有空格的字符串
- 替代字符的问题
- 字符的分割函数
- TStringList分割字符串
- php字符分割的几个函数
- 字符分割函数.
- CString 字符分割 函数
- 自定义字符分割函数
- TStringList.CommaText中空格的问题
- TStringList.CommaText中空格的问题
- SQL实现split函数,自定义分割字符,自定义取出第几个分割字符前的字符串
- 第八周--字符的替代
- sql智能分割字符函数
- string 根据字符分割函数
- Delphi的TStringList类使用详解
- 用C#实现Delphi的TStringList类
- ArrayListArrayListArrayList
- 中文绑定datagrid
- prototype学习笔记(2)
- 日期字段不使用like
- 使用C#求解N皇后问题。
- TStringList类的字符分割有问题,另贴一替代函数
- C#中,将Unicode 字符转换为ascii字符
- YouTube:平均每天视频被观看1亿次
- WTL 7.5 8.0 VC6下面的安装
- 动态编译执行source内容示例。
- 关于给处于编辑中的datagrid的编辑框指定宽度的问题
- 简单登录用存储过程
- ado.net最佳实践
- ASP.net判断客户端是否安装了某个组件的馊主意