关于delphi字符串的问题!
从数据里读出一些数据放到一个listview里 然后用户要搜索‘跑车’ 我就要把只要有跑车字眼的数据都取出来比如’法拉利跑车‘ 请问 这个字符串怎么比较呀? 不能在数据库里写存储过程来取,只能在当前的listview里取,数据库不归我们管
小弟新手 高手见笑 O(∩_∩)O~
uses
StrUtils;
var
S, SubStr: string;
I: integer;
begin
S := '法拉利跑车';
SubStr := '跑车';
I := PosEx(SubStr, S, 0); //从第N位开始查找,或者用Pos(SubStr, S)
if I >= 0 then //找到匹配的字符串
begin
//...
end;
end;
楼上的回答很不错!我来晚了!哈哈!
回帖就有分!!
回帖就有分!!
相关问答:
'Select * into '+TempTableName+' from OpenDataSource(''Microsoft.JET.OLEDB.4.0'',''Data Source='
+ExcelFilePath+';Mode=Read;Extended Properties=Ex ......
Delphi 像亡国的南宋,试问这语言还有前途吗?
Win32开发不如C#;
面像对像开发不如JAVA;
系统开发不如VC++6.0;
能用性不如VB6.0;
不支持Web开发。。。
出个Delphi 2010免费一年会有人用吗?
......
delphi 函数:
function RB(A: longint): longint;
begin
Result := (A shr 24) or ((A shr 8) and $FF00) or ((A shl 8) and $FF0000) or (A shl 24);
end;
我转成C#:
& ......
project project3.exe raised exception class ERemotableException with message 'access violation at address 004037B in module'project2.exe'.read of address 00000003'.process stopped.use ......