Computing.Net > Forums > Programming > Adding tabs in a string in vb.net

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Adding tabs in a string in vb.net

Reply to Message Icon

Name: VASS
Date: December 16, 2004 at 21:09:22 Pacific
OS: win xp
CPU/Ram: 1GB
Comment:

Hello everybody. I am trying to create a string that has columns with the use of the tab. In VB6 it was something like :
string 3 =string1 & tab(5) & string2 & tab(10)

so with the above example i would have the first string in column 0 the second in column 5 and the third in column 10.

string 1 string 2 string 3
some info other info other info
line 2 line 2 line2

How can i do that in VB.NET. I am using vbtab but i want the next column to be in the place that i have specified and not to be moved to the next tab stop if any word is bigger than the rest. In this case that word dictates where the tab will go BUT only for that line. So i get a column starting in one position and the rest in another.

I hope this makes sense. Any help please? Thank you.

(NOTE: the words string, some info, line 2 are alligned to their left. The same with string 2, other info, line 2 AND string 3, other info, line2. The preview of the message deletes the extra spaces that i have add to show the 3 columns.)



Sponsored Link
Ads by Google

Response Number 1
Name: Chi Happens
Date: December 20, 2004 at 06:40:41 Pacific
Reply:

i would guess that you would want to format the string using Format? (this was in vb6, i don't know about vb.net.) if it isnt there then you could write your own format string statment (which basically padds the string with the character specified)

for instance:

Format("10","0000")
will produce
"0010"

Hop this helps
Chi

Happy Decemberween, Everybody!


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Adding tabs in a string in vb.net

Printer paper collection in VB.NET www.computing.net/answers/programming/printer-paper-collection-in-vbnet/11265.html

call method written in VB.NET from www.computing.net/answers/programming/call-method-written-in-vbnet-from-/7816.html

Trying to get App.Path in VB.Net www.computing.net/answers/programming/trying-to-get-apppath-in-vbnet/9372.html