我有例如一个字符串数组:获取从一个String数组整个字符串如果字符串包含一个子
string[] myStrings = {"I want to take this string","This is not interesting"}
我要检查的字符串数组,如果它包含一个值,然后返回整个字符串包含它。
例子:
var index = Array.FindIndex(stringArray, x => x == stringArray.Contains("want"));
这个我想返回字符串后:I want to take this string
,因为这包含了我搜索的关键词。
我该如何获得这个结果?
谢谢,这解决了我的问题。 – drgmak