DELPHI字符串分割函数
2006-02-02 01:55
399 查看
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;
procedure StrToStrs(str:string;strs:tstrings);
var temp:string;
i:integer;
label B,E;
begin
B:
i:= ansipos('|',str);
if i=0 THEN GOTO E;
strs.Add(ansileftstr(str,i-1));
str:=ansirightstr(str,length(str)-i);
GOTO B;
E:
end;
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;
procedure StrToStrs(str:string;strs:tstrings);
var temp:string;
i:integer;
label B,E;
begin
B:
i:= ansipos('|',str);
if i=0 THEN GOTO E;
strs.Add(ansileftstr(str,i-1));
str:=ansirightstr(str,length(str)-i);
GOTO B;
E:
end;
相关文章推荐
- [update]Delphi分割字符串的函数 ExtractStrings
- Delphi分割字符串的函数
- Delphi分割字符串的函数--ExtractStrings
- Delphi分割字符串的函数
- Delphi中优秀的字符串分割函数
- Delphi中优秀的字符串分割函数
- Delphi 自带的字符串分割函数split
- Delphi中的一些字符串分割的函数收集
- Delphi分割字符串的函数ExtractStrings
- Delphi自带的字符串分割函数Split
- delphi 自带的字符串分割函数
- [update]Delphi分割字符串的函数 ExtractStrings
- php分割合并两个字符串的函数实例
- Delphi 字符、字符串、字符数组和字符指针及其相关函数
- DELPHI字符串、数组操作函数
- C/C++分割字符串:strtok函数
- 字符串分割处理,strstr函数应用
- sql 分割字符串的函数整理
- SQLserver字符串分割函数
- python之正则表达式之简单分割字符串split()函数