Creating a long string

  • Thread starter Thread starter VB Learner
  • Start date Start date
V

VB Learner

This should be so easy it's embarassing, but I've looked & looked on the
inet...
What's the equivalent in VB .NET of the old Basic String$() function?
To create string of 1000 zeros, you'd do

a$=string$(1000,0)

which you don't seem to be able to do in VB .NET. I thought

Dim s As String = Microsoft.VisualBasic.string(1000,0)

but it doesn't like it. Surely everyone must know but me!

(By the way, has anyone the time to look at my other thread "Deleting
from a table via a dataset positioning problem"? I'm still stuck on
that, too.)

Thanks to any assistor,
 
VB Learner said:
This should be so easy it's embarassing, but I've looked & looked on the
inet...
What's the equivalent in VB .NET of the old Basic String$() function?
To create string of 1000 zeros, you'd do

a$=string$(1000,0)

which you don't seem to be able to do in VB .NET. I thought

Dim s As String = Microsoft.VisualBasic.string(1000,0)

but it doesn't like it. Surely everyone must know but me!

There's a string constructor which takes a char and an int. Do you
really want a thousand '0' chars, or a thousand null chars (i.e.
Unicode 0)?
 
Well, thanks. That looks like it's going to work. I wonder why the
weird backwards syntax? Oh well :-)
 
Back
Top