Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting string length

Status
Not open for further replies.

sand133

Programmer
Joined
Jun 26, 2004
Messages
103
Location
GB
hi guys, this is a easy question but i cant do it, sorry in advance.
I have a string called str, how can i determine its length?

many thanks
 
I think you can also do this on string constants:
Code:
Dim l as Integer
l = "blahblahblahblahblah".Length
Haven't tested it, though.

Chip H.

____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
this is really basic stuff, shouldnt you be better of reading a good book first and then come back with a few more advanced questions. or a little search on google would give you the answer a lot quicker.

Christiaan Baes
Belgium

What a wonderfull world - Louis armstrong
 
JohnYingling -
I wasn't sure if that was one of the things that C# can do, and that VB.NET can't, so that's why I was a little cautious (probably shouldn't have said anything).

But it does illustrate the point that a string is a string is a string, even when you're looking at a constant vs. a variable of type string.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Operator overloading.

But some would argue that overloading an operator is a bug, not a feature. "Gee, does the addition operator convert it to int before adding, or does it just append the numbers to the string"?

Meaning that you usually have to go look at the code to understand what the other developer intended. Assuming that you even think to go look, that is...

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top