Find
简述
查找字符串。仅对已经排序好的TStringlist有效,未排序的请用IndexOf。
Find(S:String;Var Index:Integer):Boolean;
名称 | 类型 | 说明 |
---|
S | String | 字符串类型,查找的字符串。 |
Index | Integer | 整数类型。返回查找到的索引号 |
返回 | Boolean |
如果查找到则返回为真。 |
obj:=CreateObject('TStringList');
obj.Sorted:=1;
obj.CommaText:='C=456.,D=abc,A=ABC,E=666,F=A123,B=123';
f:=obj.Find("E=666",Index);
if f then return Index;
else return '查找失败';
//返回4