punkwalrus (punkwalrus) wrote,
punkwalrus
punkwalrus

VB.NET - Repeating a String of Characters

In my logs, I use separators of rows of the same character to deliniate start and stops of the program.  In VB6, repeating a string of characters was pretty simple.  You'd just do Space("=",80) if you wanted a line of 80 "="s, for example.  Now, you have to build a string:

Dim sbText As New System.Text.StringBuilder() 

'# (where to start in the string, the character to use, how many)
sbText.Insert(0, "=", 80)
oLogWrite.WriteLine(sbText.ToString)

Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments