Back to Freecodecamp

Challenge Project - Work with Variable Data in C#

curriculum/challenges/english/blocks/work-with-variable-data-in-c-sharp-console-applications/647e230c8acb466c97ccbef9.md

latest1.4 KB
Original Source

--description--

This challenge will be partially completed on the Microsoft Learn platform. Follow these instructions to complete the challenge:

  1. Go to <a href="https://learn.microsoft.com/training/modules/challenge-project-work-variable-data-c-sharp/" target="_blank" rel="noreferrer">https://learn.microsoft.com/training/modules/challenge-project-work-variable-data-c-sharp/</a> and complete all the tasks for the "Challenge Project - Work with Variable Data in C#" module. This is required to earn the "Work with Variable Data in C# Console Applications" trophy on Microsoft Learn, and qualify for the certification exam.
  2. When you are finished, come back and correctly answer the question below.

--assignment--

Complete the <a href="https://learn.microsoft.com/training/modules/challenge-project-work-variable-data-c-sharp/" target="_blank" rel="noreferrer">Work with Variable Data in C#</a> challenge project on Microsoft Learn. Then, answer the question below.

--questions--

--text--

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

--answers--

Only string arrays with elements trimmed with String.Trim() can sort


String.Trim() removes leading white space that would sort before numbers and letters.


The array sort is noticeably faster using String.Trim() on each element.

--video-solution--

2