From the course: Nail Your C# Interview
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Validate string input - C# Tutorial
From the course: Nail Your C# Interview
Validate string input
- [Instructor] When working with strings in a technical interview, you'll likely need to validate an input before processing it. For example, you can validate whether a given input string has certain properties or attributes. It might check if a string has all uppercase or all lowercase letters. It could validate whether or not the string has all alphabetical characters, or if it has at least one number. In a validation function, the output is the Boolean, either true or false, and there's always at least one input. The string either has the given properties or it does not. In fact, this validation algorithm could be your whole technical interview question. Let's try creating some validation functions in C#. There're several helpful tools in the standard library that can help us out. We can check whether a string is all uppercase by using the character's uppercase function. Let's start by creating a function…
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
-
-
-
-
-