【发布时间】:2012-01-12 01:58:27
【问题描述】:
我想根据我的搜索查询在我的应用程序中实现一个简单的搜索。 假设我有一个包含 2 个段落或文章的数组,我想在这些文章中搜索我输入的相关主题或相关关键字。
例如:
//this is my search query
string mySearchQuery = "how to play with matches";
//these are my articles
string[] myarticles = new string[] {"article 1: this article will teach newbies how to start fire by playing with the awesome matches..", "article 2: this article doesn't contain anything"};
如何根据我上面提供的搜索查询获得第一篇文章?有什么想法吗?
【问题讨论】:
标签: c# .net winforms string search