Re: strip non-numeric characters
From: January Smith (enero_at_satx.rr.com)
Date: 05/27/04
- Next message: Cowboy: "Re: strip non-numeric characters"
- Previous message: Curt_C [MVP]: "Re: Multiple web.config files in a virtual directory"
- In reply to: MattB: "strip non-numeric characters"
- Next in thread: Cowboy: "Re: strip non-numeric characters"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 27 May 2004 10:46:03 -0500
The IsNumeric function should fill the bill...
Dim MyVar As Object
Dim MyCheck As Boolean
' ...
MyVar = "53" ' Assign value.
MyCheck = IsNumeric(MyVar) ' Returns True.
' ...
MyVar = "459.95" ' Assign value.
MyCheck = IsNumeric(MyVar) ' Returns True.
' ...
MyVar = "45 Help" ' Assign value.
MyCheck = IsNumeric(MyVar) ' Returns False.
Regards,
January Smith
"MattB" <somedudeus@yahoo.com> wrote in message
news:2hmemqFen4c9U1@uni-berlin.de...
> Is there simple way to take a string that should be all numeric (like a
> credit card number) and strip out anything that isn't a digit? In the past
> I've done this in VFP using the IsDigit() function, looping through each
> character. It was a little awkward, but worked. Is there something
similar,
> or better for vb.net?
>
> Thanks!
>
> Matt
>
>
- Next message: Cowboy: "Re: strip non-numeric characters"
- Previous message: Curt_C [MVP]: "Re: Multiple web.config files in a virtual directory"
- In reply to: MattB: "strip non-numeric characters"
- Next in thread: Cowboy: "Re: strip non-numeric characters"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|