Which code segment should you add at line 03?

You are developing an ASP.NET Web application.
The application includes a Icomparer<string> implementation named CaseInsensitiveComparer that compares
strings without case sensitivity
You add the following method.(Line numbers are included for reference only.)
01 public IEnumerable<string>SortWords(string[] words)
02 {
03
04 }
You need to sort the array by word length and then by alphabetic order, ignoring case.
Which code segment should you add at line 03?

You are developing an ASP.NET Web application.
The application includes a Icomparer<string> implementation named CaseInsensitiveComparer that compares
strings without case sensitivity
You add the following method.(Line numbers are included for reference only.)
01 public IEnumerable<string>SortWords(string[] words)
02 {
03
04 }
You need to sort the array by word length and then by alphabetic order, ignoring case.
Which code segment should you add at line 03?

A.
return words.Orderby(a => a, new CaseInsensitiveComparer()).ThenBy(a =>a.Length);

B.
return words.Orderby(a =>a.Length).Orderby(a => a,new CaseInSensitiveComparer());

C.
return words.Orderby(a =>a.Length).ThenBy(a=> a, new CaseInSensitiveComparer());

D.
return words.Orderby(a =>a.Length.toString(), newCaseInSensitiveComparer());



Leave a Reply 1

Your email address will not be published. Required fields are marked *