Say someone purchases something in store and I have set up so the customer receives an e-mail confirming the purchase and date of delivery, I want to put the customers credit card details on the e-mail but i want them to be in the format off ******1234, how would i go about hashing out the first 12 digits and leaving the rest to be seen?
Share
Use the .substring() method on the credit card string to get the last four digits out and prepend those with asterisks as needed.