MCQs > IT & Programming > C# > Suppose there is a List of type Person with a property of LastName(string) and PopulateList is a function which returns a Generic List of type Person: List people = PopulateList(); What does the statement below do? people.Sort((x, y) => string.Compare(x.LastName, y.LastName));

C# MCQs

Suppose there is a List of type Person with a property of LastName(string) and PopulateList is a function which returns a Generic List of type Person:

List<Person> people = PopulateList();

 

What does the statement below do?

people.Sort((x, y) => string.Compare(x.LastName, y.LastName));

Answer

Correct Answer: It will sort the string in place.

Explanation:

Note: This Question is unanswered, help us to find answer for this one

C# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

C# Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it