Get Credit Card Type
How to get C-card type, how to know the input card number is Visa or Master Card ? here the code for CreditCard.cs public class CreditCard { private string AmericanExpressPattern => @"^3[47][0-9]{13}$"; private string MasterCardPattern => @"^5[1-5][0-9]{14}$"; private string VisaCardPattern => @"^4[0-9]{12}(?:[0-9]{3})?$"; private string DinersClubCardPattern => @"^3(?:0[0-5]|[68][0-9])[0-9]{11}$"; private string EnRouteCardPattern => @"^(2014|2149)"; private string DiscoverCardPattern => @"^6(?:011|5[0-9]{2})[0-9]{12}$"; private string JcbCardPattern => @"^(?:2131|1800|35\d{3})\d{11}$"; private Dictionary CreditRegxs { get; set; } public CreditCard() { CreditRegxs = new Dictionary () { {"American Express",AmericanExpressPattern}, {"Mastercard",MasterCardPattern}, {"Visa...