I have an array and I want to sort this array by its element' specific character count.
var myNewArray = myArray.ToList().Sort(u => u.Name.Split(' ').Length);
but this does not work at all.
How can I provide the LINQ code for this problem ?
myArray = "word1 word2" myArray = "word1" myArray = "word3 word2 word2 word2"
when Apply sort my array element order must be like myArray,myArray,myArray