Does anyone know how to make the STRING() function work in VB.Net. The samples do not seem to work which makes me believe there is a class missing. What class is it a part of?
e.g. STRING(10,"*") or rc = STRING(10,"*")
Printable View
Does anyone know how to make the STRING() function work in VB.Net. The samples do not seem to work which makes me believe there is a class missing. What class is it a part of?
e.g. STRING(10,"*") or rc = STRING(10,"*")
I spent a lot of time trying to find a substitute function. There isn't one!!! but there's an easier way :D
VB Code:
Dim rc As String rc = New String("*", 10)
:)
Thanks, your way looks nice and short which I like. I got away with creating a loop for the number of characters and concactenated the string to itself.
String is a class now thats why it isn't a function name anymore, but the string class has a PadLeft and PadRight function that does what String used to.
VB Code:
Dim str As String = "" str = str.PadLeft(10, "*") MsgBox(str)
Although Mr. Polite's way is better if it is starting that way.