I am new in c# and stucked with getting value from arrays. I can check if the string contains any string in array but i have no idea how to get the value of matched string.
In my code i want to get "When is" as a string.
string testwords = "When is your birthday";
string[] myStrings = { "Who is ", "When is ", "What is " };
if(myStrings.Any(testwords.Contains))
FindIndex()method. See duplicates. Your predicate might be just like you show above, i.e.testwords.Contains.