user1514077
user1514077

Reputation: 71

Stringbuilder Formatting

How can i format the StringBuilder for the output below to be aligned in a manner that it's properly padded, Right now it's just a mess!.I am using String Builder to make string in a manner :Stra.append(),Stra.append(" ")

String To Format

Upvotes: 0

Views: 4228

Answers (2)

Jules
Jules

Reputation: 559

You could use stringBuilder.AppendFormat("{0,16}", number). This will make your number right-aligned with a width of 16.

Upvotes: 1

munnster79
munnster79

Reputation: 578

you should be able to use vbtab to insert tabs or vbcrlf to insert a carriage return/line feed ie

Stra.append(vbTab)

Stra.append(VbCrLf)

Upvotes: 0

Related Questions