Thursday, 18 April 2013

String Fuction to put given Charactor for given lenth of String

 Hello,
          Can you need to print a string as Given bello..
           dim str as String= "----------------------------------------------------"

There is another flexible way to print this line..

USING VB :
           String(Length,CharString)
eg.
        str= String(50,"-")


USING .NET
strDup : Returns a string or object consisting of the specified character repeated the specified number of times.
        str= Strings.StrDup(Length,"-")
eg.
       str=Strings.StrDup(50,"-")

Hope this will help you...
Regards,
Ganesh S. Chatraband.


No comments:

Post a Comment