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

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…

Contents