Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



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

Posts: 13
Trades: 0
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
 
 
Register now for full access!
Old 09-21-2004, 04:28 PM
ACJavascript's Avatar
Humble Mod

Posts: 548
Location: CT, USA
Trades: 0
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?
__________________

Please login or register to view this content. Registration is FREE
- 100 Satisfied Customers - Custom Programming and Web Development
ACJavascript is offline
Reply With Quote
View Public Profile Visit ACJavascript's homepage!
 
Old 09-22-2004, 12:11 AM
WebcyteDesign's Avatar
Registered User

Posts: 159
Location: Hamilton
Trades: 0
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 Search this Thread
Search this Thread:

Advanced Search

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

BB 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.10889 seconds with 12 queries