how can I Check if a string contains another string?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Why iterate when you can use LINQ? I think you’re asking to get all the strings that are substrings of other strings in the array (please correct me if I’m wrong):
Update
After your update, the question seems much easier than original. If you just want to find out if a string contains another string, just use the Contains method:
Or if you want to do a case insensitive search, you have to do things a little differently: