Is Chinese by Regex - CSharp System.Text.RegularExpressions

CSharp examples for System.Text.RegularExpressions:Match String

Description

Is Chinese by Regex

Demo Code


using System.Globalization;
using System.Text.RegularExpressions;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//ww w .j  ava  2 s.c  om

public class Main{
        public static Boolean IsChinese(String source)
        {
            return Regex.IsMatch(source, @"^[\u4e00-\u9fa5]+$", RegexOptions.IgnoreCase);
        }
}

Related Tutorials