Click here to Skip to main content
15,892,768 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi sir,
in my project first time user enter credit card number that number is stored in database. and that credit card number is displayed in textbox.
my aim is not to display total creditcard number. display only last 4 numbers remaing display like xxxx.

display like Ex: xxxxxxxxxx1234

please give me a solution

Thanks
Posted

If you don't know how to do this, you should NOT be trusted with people's credit card numbers. You just show the Xs and the last four characters, which you can get with a substring in your stored proc ideally.
 
Share this answer
 
Hi Ajay

:) an do it like this. i used it to display card numbers in grid.



int cardlen = CardNumber.Length;
string last4number = CardNumber.Substring(cardlen - 4);

CardNumber = "XXXX XXXX XXXX " + last4number;
return CardNumber;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900