473,387 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 11571

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Krakatioison | last post by:
My sites navigation is like this: http://www.newsbackup.com/index.php?n=000000000040900000 , depending on the variable "n" (which is always a number), it will take me anywhere on the site......
9
by: John F Dutcher | last post by:
I use code like the following to retrieve fields from a form: recd = recd.append(string.ljust(form.getfirst("lname",' '),15)) recd.append(string.ljust(form.getfirst("fname",' '),15)) etc.,...
9
by: Derek Hart | last post by:
I wish to execute code from a string. The string will have a function name, which will return a string: Dim a as string a = "MyFunctionName(param1, param2)" I have seen a ton of people...
10
by: Angus Leeming | last post by:
Hello, Could someone explain to me why the Standard conveners chose to typedef std::string rather than derive it from std::basic_string<char, ...>? The result of course is that it is...
37
by: Kevin C | last post by:
Quick Question: StringBuilder is obviously more efficient dealing with string concatenations than the old '+=' method... however, in dealing with relatively large string concatenations (ie,...
2
by: Andrew | last post by:
I have written two classes : a String Class based on the book " C++ in 21 days " and a GenericIpClass listed below : file GenericStringClass.h // Generic String class
2
by: s | last post by:
I'm getting compile errors on the following code: <code> #include <iostream> #include <fstream> #include <list> #include <string> using namespace std;
2
by: Badass Scotsman | last post by:
Hello, Using VB and ASP,NET I would like to be able to search a STRING for a smaller STRING within, based on the characters which appear before and after. For example: String1 = " That was...
11
by: ramu | last post by:
Hi, Suppose I have a string like this: "I have a string \"and a inner string\\\" I want to remove space in this string but not in the inner string" In the above string I have to remove...
8
by: drjay1627 | last post by:
hello, This is my 1st post here! *welcome drjay* Thanks! I look answering questions and getting answers to other! Now that we got that out of the way. I'm trying to read in a string and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.