VB.NET - Replicate - Asked By sandeep v on 02-Dec-05 04:33 AM

wts equivalent function for replicate in VB.NET
Replicate("0", 8 - Len(varSeq))

try - Asked By Sathish S on 02-Dec-05 05:21 AM

Console.WriteLine((Replicate("0", 5))

Private Function Replicate(ByVal str As String, ByVal Times As Int32) As String
        Replicate = String.Empty
        For i As Integer = 1 To Times
            Replicate += str
    End Function

Try this - Asked By Jon Wojtowicz on 02-Dec-05 08:51 AM

Dim s As String = New String("0"c, 8-varSeq.Length)

you'll need to put in guarding code to make sure you do not have a negative number for the repeat.