Print Page | Close Window

How to display xxx-xxx-xxxx-1234

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=14591
Printed Date: 30 March 2026 at 6:55am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: How to display xxx-xxx-xxxx-1234
Posted By: rocketdawg
Subject: How to display xxx-xxx-xxxx-1234
Date Posted: 06 April 2005 at 10:13pm
Instead of the whole credit card #?
 
If anyone knows how to format the display, I would surely appreciate it.
 
asp classic please.
 
Thank you anyone.



Replies:
Posted By: ub3rl337ch3ch
Date Posted: 07 April 2005 at 1:10am
probably something along the lines of a trim function... i'll have a look around for you...


Posted By: ub3rl337ch3ch
Date Posted: 07 April 2005 at 1:25am
dim number, trimmed
number=request.form("CCard")
trimmed=Right(number,4)
response.write "XXXX-XXXX-XXXX-" & trimmed
i think that is the right syntax.
anyway, below is a working eg.
dim txt
txt="This is a beautiful day!"
document.write(Right(txt,11))
Output:
utiful day!


Posted By: rocketdawg
Date Posted: 07 April 2005 at 12:44pm
Superb !
 
Thank you very much !
 
This forum is great. Every time I get stumped and ask a question (all 4 of them), it is answered inside of a day. I would like to thank everyone that answers questions for their community spirit in helping others.
 
Have a great day !!
 
rd


Posted By: dj air
Date Posted: 08 April 2005 at 6:24am
but remember some credit cards have different ammount of numbers


i have done a script that

CardShort = len(cardNumber) - 4

for looper = 1 to ubound(CardShort)

strCardNumberTemp = strCardNumberTemp & "*"

next

cardNumber = strCardNumberShort & Right(cardNumber,4)

thinking oif you want the - also .. you would have to do a diffferent sligfhtly checking what the value is if its a number or not and if not add a - else *



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net