I have an array string[] data with 512 items. Can I use LINQ to find all elements that contain the string "tx"?
I did try data.Where but it was not a valid statement.
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.
Make sure you have
using System.Linq;at the top of your file. data.Where should work just fine.And you need to be using .NET 3.5 or above.
If you have this, then Jons answer should work perfectly.