Consider I have an array like the following one:
string[] Files = {"NO. 1", "NO. 2", "NO. 3", "NO. 4", "NO. 5", "NO. 6", "NO. 7"};
I want to find the element with the maximum number. How can I do this by Linq queries in C#?
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.
If you are using LINQ to objects (rather than to a database)… then this’ll do it.
The exact string manipulation will of course change if your list is some way different to what you posted.
There may be more elegant LINQ functions you can use, but these are the ones I found.