i want a way to do validations for a String (the text should contain only characters, and not _ @ or any number) .. i found a code that does validations for integers, but not for strings.. Please could u, send me the code to conduct validations for Strings,, i am a new to C# ..

This is as basic as I will get.

using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string MyString = "A @string & and 2.";
            Console.WriteLine(MyString);
            for (int charpos = 0; charpos < MyString.Length; charpos++)
            {
                Console.WriteLine(Char.IsLetter(MyString, charpos));    
            }
            //Keep the console on screen
            Console.WriteLine("Press any key to quit.");
            Console.ReadKey();
        }
    }
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.