String length problem

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2009
Posts: 2
Reputation: glennt is an unknown quantity at this point 
Solved Threads: 0
glennt glennt is offline Offline
Newbie Poster

String length problem

 
0
  #1
19 Days Ago
I understood that a string in VB .Net maximum length was quite large (could be way over 1000 characters) but do not know for sure. I keep having a problem when I concatenate one string to another and the result is the second string.

Example:
Str1 = “this is the first test”
Str1 &= “this is the second test”

Now Str1 = “this is the second test”

The lengths of the strings in the example are not correct (much longer) but are under 1000 characters. Does anyone have a clue?
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 2
Reputation: glennt is an unknown quantity at this point 
Solved Threads: 0
glennt glennt is offline Offline
Newbie Poster
 
-1
  #2
19 Days Ago
I figured out the problem. There was a NULL character in the string causing me to not see the first part of the string.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2,597
Reputation: adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of 
Solved Threads: 460
Moderator
adatapost's Avatar
adatapost adatapost is online now Online
Posting Maven
 
0
  #3
18 Days Ago
The theoretical limit may be 2,147,483,647, but the practical limit is nowhere near that. Since no single object in a .Net program may be over 2GB and the string type uses unicode (2 bytes for each character), the best you could do is 1,073,741,823, but you're not likely to ever be able to allocate that on a 32-bit machine.
Failure is not fatal, but failure to change might be. - John Wooden
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC