Is Hex String - CSharp System

CSharp examples for System:Hex

Description

Is Hex 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;/* w  ww.  j  a  v a  2 s.  c  o  m*/

public class Main{
        public static bool IsHexString(this string s)
		{
			return Regex.IsMatch(s, @"^(?:[0-9A-Fa-f]{2})+$");
		}
}

Related Tutorials