Connecting Tech Pros Worldwide Help | Site Map

string-manipulation functions

John A Grandy
Guest
 
Posts: n/a
#1: Nov 20 '05
what are the preferred VB.NET analogues for IsNumeric() and Len() and CInt()
& similar string-manipulation functions in VB6


Justin Weinberg
Guest
 
Posts: n/a
#2: Nov 20 '05

re: string-manipulation functions



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" <johnagrandy@yahoo.com> wrote in message
news:uCc5SzHfDHA.2320@TK2MSFTNGP12.phx.gbl...[color=blue]
> what are the preferred VB.NET analogues for IsNumeric() and Len() and[/color]
CInt()[color=blue]
> & similar string-manipulation functions in VB6
>
>[/color]


Cor
Guest
 
Posts: n/a
#3: Nov 20 '05

re: string-manipulation functions


John,
[color=blue]
> what are the preferred VB.NET analogues for IsNumeric() and Len() and[/color]
CInt()[color=blue]
> & similar string-manipulation functions in VB6
>[/color]

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.


William Ryan
Guest
 
Posts: n/a
#4: Nov 20 '05

re: string-manipulation functions


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" <johnagrandy@yahoo.com> wrote in message
news:uCc5SzHfDHA.2320@TK2MSFTNGP12.phx.gbl...[color=blue]
> what are the preferred VB.NET analogues for IsNumeric() and Len() and[/color]
CInt()[color=blue]
> & similar string-manipulation functions in VB6
>
>[/color]


Lucas Tam
Guest
 
Posts: n/a
#5: Nov 20 '05

re: string-manipulation functions


"John A Grandy" <johnagrandy@yahoo.com> wrote in
news:uCc5SzHfDHA.2320@TK2MSFTNGP12.phx.gbl:
[color=blue]
> what are the preferred VB.NET analogues for IsNumeric() and Len() and
> CInt() & similar string-manipulation functions in VB6[/color]


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

--
Lucas Tam (REMOVEnntp@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#6: Nov 20 '05

re: string-manipulation functions


Hello,

"Justin Weinberg" <jweinberg@bravopos.com> schrieb:[color=blue]
> len - string.length[/color]

ACK.
[color=blue]
> cint - ctype("x", int32)[/color]

No... That's (IMO) really bad. I would prefer 'Integer.Parse' or
'Convert.ToInt32'.
[color=blue]
> 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.[/color]

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

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet


Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#7: Nov 20 '05

re: string-manipulation functions


Hello,

"William Ryan" <dotnetguru@comcast.nospam.net> schrieb:[color=blue]
> 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.[/color]

Examples for "backward compatibility" stuff?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet


Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#8: Nov 20 '05

re: string-manipulation functions


Hello,

"John A Grandy" <johnagrandy@yahoo.com> schrieb:[color=blue]
> what are the preferred VB.NET analogues for
> IsNumeric() and Len() and CInt() & similar string-
> manipulation functions in VB6[/color]

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

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet


Closed Thread