如題
解决方案 »
- delphi能不能实现将功能菜单放进数据库?
- if( ((ADOQuery1.实收货款1+ADOQuery1.实收货款2)<>0),(ADOQuery1.实收货款1+ADOQuery1.实收货款2),'')是什么 意思?
- 如何阅读DELPHI源码
- 谁用过TUdpSocket吗?
- 请问数据字典怎么做呀,我是用ACCESS做的数据库,谢谢拉
- 小声问下自己写的结构体在什么地方赋初值
- inhereted的问题
- 动态生成的Panel,如何编写他的OnClick事件???
- 这里有没有北京的DELPHI程序员或DELPHI高手,爱好者?
- 关于调用
- 如何枚举系统进程?
- 看看这段程序的作用是什么,关于FormHide的.
然后判断#,用COPY()分开
var
hs : string;
p : integer;
begin
if Length(s)=0 then
Exit;
p:=Pos(Separator,s);
while P<>0 do
begin
hs:=Copy(s,1,p-1);
Terms.Add(hs);
Delete(s,1,p);
p:=Pos(Separator,s);
end;
if Length(s)>0 then
Terms.Add(s);
end;
S: string;
SL: TStringList;
begin
S := 'abc#kkk22#sfsdfds#';
SL := TStringList.Create;
ExtractStrings(['#'], [], PChar(S), SL);
//SL已经存储了你分开的string
//另外,这个函数不保存空串
ShowMessage(SL.Text);
SL.Free;
end;
ExtractStrings functionFills a string list with substrings parsed from a delimited list.UnitClassesCategorystring handling routines (null-terminated)function ExtractStrings(Separators, WhiteSpace: TSysCharSet; Content: PChar; Strings: TStrings): Integer;DescriptionUse ExtractStrings to fill a string list with the substrings of the null-terminated string specified by Content.Separators is a set of characters that are used as delimiters, separating the substrings. Carriage returns, newline characters, and quote characters (single or double) are always treated as separators. Separators are ignored when inside a quoted string until the final end quote. (Note that quoted characters can appear in a quoted string if the quote character is doubled.)WhiteSpace is a set of characters to be ignored when parsing Content if they occur at the beginning of a string.Content is the null-terminated string to parse into substrings.Strings is a string list to which all substrings parsed from Content are added. The string list is not cleared by ExtractStrings, so any strings already in the string list are preserved.ExtractStrings returns the number of strings added to the Strings parameter.Note: ExtractStrings does not add empty strings to the list.