string userInput = Console.ReadLine(); bool isValid = CheckUserArg(userInput); if(isValid) { //Do something } else { Console.WriteLine("Invalid input"); }
public void SomeFunction(string input1, string input2) { bool isInput1Valid = CheckUserArg(input1); bool isInput2Valid = CheckUserArg(input2); if(isInput1Valid && isInput2Valid) { //Do something } else { Console.WriteLine("Inputs are not valid."); } }The package library for CheckUserArg may vary depending on the implementation, but it could potentially be part of a larger package or library for input validation in C#.