Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > using isnumeric

Reply
Thread Tools

using isnumeric

 
 
Joey
Guest
Posts: n/a
 
      10-14-2004
I am using an import process that scans an html file and exports data to
a sql database table.

One of the fields I import, on occasion has 2 numeric characters at the
very end. For example "thename 04".

What I need to do is delete those numeric characters, if they exist.

I thought about something like this:
if isnumeric(right(thename,2))=TRUE then

....but what's next? How do I make a new THENAME field without those
last two numeric characters if they exist?

Thanks for the help!


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      10-14-2004
Joey wrote:
> I am using an import process that scans an html file and exports data
> to a sql database table.
>
> One of the fields I import, on occasion has 2 numeric characters at
> the very end. For example "thename 04".
>
> What I need to do is delete those numeric characters, if they exist.
>
> I thought about something like this:
> if isnumeric(right(thename,2))=TRUE then
>
> ...but what's next? How do I make a new THENAME field without those
> last two numeric characters if they exist?
>



To do it in vbscript, you would do this:

thename = left(thename,len(thename)-2)


Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
 
 
 
Manohar Kamath
Guest
Posts: n/a
 
      10-14-2004
You say "if they exist" -- meaning they may not? If so, you could do the
following:

Dim stringArray
dim namePart

' Split the string on the empty space
stringArray = Split(theName, " ")

' Retrieve the string before the space. if the space does not
' exist, you will get the entire string
namePart = stringArray(0)

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com


"Joey" <> wrote in message
news:%...
> I am using an import process that scans an html file and exports data to
> a sql database table.
>
> One of the fields I import, on occasion has 2 numeric characters at the
> very end. For example "thename 04".
>
> What I need to do is delete those numeric characters, if they exist.
>
> I thought about something like this:
> if isnumeric(right(thename,2))=TRUE then
>
> ...but what's next? How do I make a new THENAME field without those
> last two numeric characters if they exist?
>
> Thanks for the help!
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
 
 
Reply

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there any IsNumeric in C#? Steve Kershaw ASP .Net 10 02-03-2012 03:27 AM
IsNumeric C# equivalent Stephan Bour ASP .Net 12 01-26-2012 12:48 PM
Name 'IsNumeric' is not declared??? David Lozzi ASP .Net 4 12-07-2004 01:35 AM
IsNumeric Function =?Utf-8?B?TXJNaWtl?= ASP .Net 5 11-29-2004 02:51 PM
Isnumeric and importing vb functions martin ASP .Net 3 07-19-2004 11:41 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57