Extension method is introduced by Microsoft in .Net 3.5. With help of extension method, developer can extend any class without change in original source code. Extension methods are static methods that can appear to be part of a class without actually being in the source code for the class. So extension method is one of the richest feature of .net 3.5.
Here I create class for string validation which extends string class. With help of bellow class we can validate some regular string validation like email, password , numeric etc. It provide facility to validate your own custom regular expression.
Code
Here I create class for string validation which extends string class. With help of bellow class we can validate some regular string validation like email, password , numeric etc. It provide facility to validate your own custom regular expression.
Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;