Using C# to check if string contains a string in string array

Posted by aspdotnetuser on Stack Overflow See other posts from Stack Overflow or by aspdotnetuser
Published on 2010-05-26T11:31:03Z Indexed on 2010/05/26 11:41 UTC
Read the original article Hit count: 280

Filed under:

Hi,

I want to use C# to check if a string value contains a word in a string array. For example,

string stringToCheck = "text1text2text3";

string[] stringArray = ("text1", etc... )

if(stringToCheck.contains stringArray( //one of the items?
{

}

How can I check if the string value for 'stringToCheck' contains a word in the string array?

Thanks,

© Stack Overflow or respective owner

Related posts about c#