|
-
Jul 11th, 2002, 12:34 PM
#1
Thread Starter
Junior Member
STRING() won't work
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,"*")
-
Jul 11th, 2002, 02:25 PM
#2
I spent a lot of time trying to find a substitute function. There isn't one!!! but there's an easier way 
VB Code:
Dim rc As String
rc = New String("*", 10)
-
Jul 12th, 2002, 05:14 PM
#3
Thread Starter
Junior Member
Loop
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.
-
Jul 12th, 2002, 06:25 PM
#4
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.
Last edited by Edneeis; Jul 12th, 2002 at 06:31 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|