One Problem met when Using String class in VB.NET

bergie

Member
Joined
Jun 22, 2004
Messages
12
Programming Experience
3-5
I want to define a string with 1000 NULL. and i know in VB6, it's comfortable to write like this kind:String$(1000,0),but in VB.net, it does not support this kind of constructure. any one knows how to do it. thanks very much
 

Solitaire

Well-known member
Joined
Jun 28, 2004
Messages
465
Location
New York
Programming Experience
10+
Use StrDup instead of String$

The function has been renamed from String to StrDup. However, it won't work with 0 as the second argument, giving an error. If you just want 1000 spaces, then try this: StrDup(1000, " ")

StrDup(5, Chr(0)) does not give an error, but any text included in the string after it does not print.
 
Top Bottom