Is Only Characters by Regex - CSharp System.Text.RegularExpressions

CSharp examples for System.Text.RegularExpressions:Match String

Description

Is Only Characters by Regex

Demo Code


using System.Text.RegularExpressions;
using System;/*from  w  w  w.j ava  2s  . com*/

public class Main{
        public static bool IsOnlyCharacters(string character)
        {
            Regex regex = new Regex(@"^.[A-Za-z]+$");
            return regex.IsMatch(character);
        }
}

Related Tutorials