Reply
How to check a numeric ???
Old 09-09-2004, 04:39 AM How to check a numeric ???
Novice Talker

Posts: 13
if i have a text as follow :

my phone number is 0123456789

i need to check the text and not allow to have more than 7 digit number occur in the text and then change the 0123456789 to xxxxxxxxx.

Finally the text will become :

my phone number is xxxxxxxxxx

I'm using asp and sql server.....
superman2004 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 09-21-2004, 03:28 PM
ACJavascript's Avatar
Humble Mod

Posts: 548
Location: CT, USA
Hello,

You can do this:

<%

Dim howlong,phone

phone="12312312"

howlong=Len(phone)

IF howlong>7 THEN
Response.Write "Your number is to long"
ELSE
phone="xxxxxxxxxx"
END IF

%>

If you need to remove the number form the text you can use Right(string,length) to cut the number out.

will that help?
__________________
CYTech-services.com - 100 Satisfied Customers - Custom Programming and Web Development
ACJavascript is offline
Reply With Quote
View Public Profile Visit ACJavascript's homepage!
 
Old 09-21-2004, 11:11 PM
WebcyteDesign's Avatar
Extreme Talker

Posts: 159
Location: Hamilton
Dim strString
Dim i


strString = "my phone number is 0123456789"

for i = 1 to len(strString)
if isNumeric(mid(strString, i 1)) then
strString = replace(strString, mid(strString, i 1), "x")
end if
next


---------------------------------------------------------

out put should be: my phone number is xxxxxxxxxx
WebcyteDesign is offline
Reply With Quote
View Public Profile Visit WebcyteDesign's homepage!
 
Reply     « Reply to How to check a numeric ???
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11298 seconds with 12 queries