在Delphi 2007中,是否有集成的解决方案可以检查TStringList是否包含某个值的一部分?
例如:
例如:
List.AddObject('This is a string', customStringObject1);
List.AddObject('This is a mushroom', customStringObject2);
List.AddObject('Random stuff', customStringObject3);
搜索 "This is a" 应该会返回 "true",因为前两个元素部分包含了这个字符串。
到目前为止,我所知道的唯一方法是使用 TStringList.find(string,integer)
,但是它执行的是完整的字符串比较,也就是说,只有当搜索 This is a string 时才会返回 true。
有什么建议吗?