String(2, 0)???

  • Thread starter Thread starter DraguVaso
  • Start date Start date
D

DraguVaso

Hi,

In VB6 we used to have the function String(2, 0), which gave a string with
lenght 2, containing "0" -> in total "00".

But what is the VB.NET equivalent of this? Anybody got any idea?

Thansk a lot,

Pieter
 
DraguVaso said:
In VB6 we used to have the function String(2, 0), which gave a string
with lenght 2, containing "0" -> in total "00".

But what is the VB.NET equivalent of this? Anybody got any idea?

s = new string("0"c, 2)
or
s = Strings.StrDup(2, "0"c)
 
* "DraguVaso said:
In VB6 we used to have the function String(2, 0), which gave a string with
lenght 2, containing "0" -> in total "00".

But what is the VB.NET equivalent of this? Anybody got any idea?

'Microsoft.VisualBasic.Strings.StrDup' or '... = New String("0"c, 100)'.
 
.. . .
In VB6 we used to have the function String(2, 0), which gave a string
with lenght 2, containing "0" -> in total "00".

But what is the VB.NET equivalent of this?

Look at the PadLeft() and PadRight() methods on the String Class.

HTH,
Phill W.
 
Back
Top