Is Hex Color String - CSharp System

CSharp examples for System:Hex

Description

Is Hex Color String

Demo Code


using System.Text.RegularExpressions;
using System.Net.Mail;
using System.Linq;
using System.Drawing;
using System.Collections.Specialized;
using System.Collections.Generic;
using System.Collections;
using System;// ww  w  . jav a2 s .c  om

public class Main{
        public static bool IsHexColorString(this string s)
		{
			return Regex.IsMatch(s, @"^\#?[0-9A-Fa-f]{6}$");
		}
}

Related Tutorials