Automated Output Spacing ??

Elfman

Member
Joined
Nov 6, 2007
Messages
12
Programming Experience
1-3
I'm trying to create a file from within vb.net.

This file has to keep certain spacing. How can I add spaces to the end of a string to ensure i have enought spaces in the file ??


- Elfman
 
VB.NET:
Dim newStr As String = "your text"
newStr += " "
you might want to look at
VB.NET:
.padleft
and
VB.NET:
.padright
 
You can also do composite formatting with String.Format where the alignment part indicates the preferred formatted field width and will automatically pad shorter strings. Enough room have to be specified because this value won't crop longer strings to fit the field.
 
Back
Top