Instead of converting the string to char[], you can do this:
if(!"ABCDF".Contains(userInput))
{
Console.WriteLine("Enter valid letter");
}
More Related Contents:
- How to cut up a string from an input file with Regex or String Split, C#?
- How to show the “paste Json class” in visual studio 2012 when clicking on Paste Special?
- How to run a test many times with data read from .csv file (data driving)
- How can I fix the Microsoft Visual Studio error: “package did not load correctly”?
- Visual Studio “Could not copy” …. during build
- ReSharper “Cannot resolve symbol” even when project builds
- ReSharper WPF error: “Cannot resolve symbol “MyVariable” due to unknown DataContext”
- Closing Excel Application Process in C# after Data Access
- Best way to deploy Visual Studio application that can run without installing
- Using async without await
- How can I get user type C# syntax highlighting working again in VS 2012 RC?
- Controlling execution order of unit tests in Visual Studio
- How to reference Microsoft.Office.Interop.Excel dll?
- How can I change IIS Express port for a site
- How to turn off brackets/quotes auto-completion in Visual Studio
- OWIN Startup Class Missing
- ASP.NET MVC 4 + Ninject MVC 3 = No parameterless constructor defined for this object
- NuGet Package Manager: ‘AutoMapper’ already has a dependency defined for ‘Microsoft.CSharp’
- Can the Visual Studio Debugger display strings unquoted/unescaped?
- Could not load file or assembly ‘Microsoft.ReportViewer.Common, Version=11.0.0.0
- IIS Express Immediately shutting-down running site after stopping web application
- Is there a format code shortcut for Visual Studio?
- Symbol file not loading for debugging custom project in Visual Studio 2012
- How to get a right click mouse event? Changing EventArgs to MouseEventArgs causes an error in Form1Designer?
- using statement FileStream and / or StreamReader – Visual Studio 2012 Warnings
- Visual Studio 2012 Web API project won’t run – can’t find Newtonsoft.Json
- How to deploy a Metro App to the Desktop?
- Moq & Interop Types: works in VS2012, fails in VS2010?
- generate a Zip file from azure blob storage files
- C# 6.0 Support in Visual Studio 2012