469,344 Members | 6,443 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,344 developers. It's quick & easy.

string-manipulation functions

what are the preferred VB.NET analogues for IsNumeric() and Len() and CInt()
& similar string-manipulation functions in VB6
Nov 20 '05 #1
7 11407

len - string.length
cint - ctype("x", int32)

There isn't an analogous IsNumeric to my knowledge (but IsNumeric is still
there! Go VB!). A C# programmer would try int32.Parse or the appropriate
type and take action on an exception.
"John A Grandy" <jo*********@yahoo.com> wrote in message
news:uC**************@TK2MSFTNGP12.phx.gbl...
what are the preferred VB.NET analogues for IsNumeric() and Len() and CInt() & similar string-manipulation functions in VB6

Nov 20 '05 #2
Cor
John,
what are the preferred VB.NET analogues for IsNumeric() and Len() and CInt() & similar string-manipulation functions in VB6


They still exist as a major part from Vb.net, this question is often
discussed in this newsgroup.
So you can search for those threads (keywords like mid or len)
Beside this you can use much more methodes.
Look for instance for the string members and the regex, but there are a lot
more.

An advise often given in this newsgroup is, take that what fits you the
most, the result of the endcode will not be a big difference.

I hope this helps a little bit.
Cor

Ps. not all functions still exist.
Nov 20 '05 #3
I totally agree with Cor, but if you want to use them..

Type in Microsoft.VisualBasic and when you hit the next period, you'll see
them all there in intellisense.

As a suggestion though, look through the string and regex classes, there is
a lot of backward compatibility in VB.NET for VB6, but that doesn't
necessarily mean you should use it.

HTH,

Bill
"John A Grandy" <jo*********@yahoo.com> wrote in message
news:uC**************@TK2MSFTNGP12.phx.gbl...
what are the preferred VB.NET analogues for IsNumeric() and Len() and CInt() & similar string-manipulation functions in VB6

Nov 20 '05 #4
"John A Grandy" <jo*********@yahoo.com> wrote in
news:uC**************@TK2MSFTNGP12.phx.gbl:
what are the preferred VB.NET analogues for IsNumeric() and Len() and
CInt() & similar string-manipulation functions in VB6

CInt, IsNumeric, and Len are still there. However, for Length, you can go
String.Length() as well.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 20 '05 #5
Hello,

"Justin Weinberg" <jw*******@bravopos.com> schrieb:
len - string.length
ACK.
cint - ctype("x", int32)
No... That's (IMO) really bad. I would prefer 'Integer.Parse' or
'Convert.ToInt32'.
There isn't an analogous IsNumeric to my knowledge (but
IsNumeric is still there! Go VB!). A C# programmer would
try int32.Parse or the appropriate type and take action on an
exception.


You can use 'Double.TryParse' instead of 'IsNumeric'.

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #6
Hello,

"William Ryan" <do********@comcast.nospam.net> schrieb:
As a suggestion though, look through the string and
regex classes, there is a lot of backward compatibility
in VB.NET for VB6, but that doesn't necessarily mean
you should use it.


Examples for "backward compatibility" stuff?

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #7
Hello,

"John A Grandy" <jo*********@yahoo.com> schrieb:
what are the preferred VB.NET analogues for
IsNumeric() and Len() and CInt() & similar string-
manipulation functions in VB6


If you understand what "BASIC" means, still use these functions.

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by Krakatioison | last post: by
9 posts views Thread by John F Dutcher | last post: by
9 posts views Thread by Derek Hart | last post: by
10 posts views Thread by Angus Leeming | last post: by
2 posts views Thread by Andrew | last post: by
2 posts views Thread by s | last post: by
2 posts views Thread by Badass Scotsman | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.