Is there a function in the VB that replicates a specific character?
For example, I need to put 100 of a zero string.
Note. I need a build-in function or better way which doesn't use a loop.
Printable View
Is there a function in the VB that replicates a specific character?
For example, I need to put 100 of a zero string.
Note. I need a build-in function or better way which doesn't use a loop.
I am pretty sure you are gonna have to use a loop to do this, there is no built in function that I am aware of.
Yes, you use String.
To make 100 spaces, you'd do this:
strString = String(100, " ")
Will this better?
Code:Dim strString As String
strString = String(100, chr(0))
or
strString = String(100, vbNull)
Chris, i think you mean vbNullchar. vbNull is used as returnvalues for variants
Oops... being catch by ked-Guru....
Thanks alot. The String function is what I've been looking for..:)