From the course: Nail Your C# Interview
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Normalize string input - C# Tutorial
From the course: Nail Your C# Interview
Normalize string input
- [Instructor] Before processing a string for a technical interview, it can be helpful to normalize it to a common form in order to make your algorithm more efficient. Let's say you're searching for a particular letter within a string. You could search for that letter once in the lowercase form and once in the uppercase form. This means you would have to run two different searches to find out if the letter exists. Now, another way to go about this is to convert the string to all lower case. With this approach, you could search for the letter in the lower case form and only have to search once for one form of the letter. With two forms, you're still iterating through the string twice, but if the number of different forms the letter can appear as increases, your algorithm becomes less and less efficient. If you normalize it, it makes your code less complex. You search for one form of the data instead of multiple. This is…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Concatenate strings with different methods2m 49s
-
(Locked)
Normalize string input4m 55s
-
(Locked)
Validate string input6m 47s
-
(Locked)
Access data from strings7m 30s
-
(Locked)
Create algorithm-driven strings in C#7m
-
(Locked)
Solution: Developing a palindrome checker3m 38s
-
(Locked)
Solution: Reverse each word2m 15s
-
-
-
-
-