Knowledge check

Completed

Check your knowledge

1.

To sort a string array, why is it important to use the String.Trim() method on each array element before sorting?

2.

Both foreach and for are good choices to iterate small single dimension arrays like {"cat", "fox", "dog", "snake", "eagle"}, but when is it best to use a for loop?