James,
As Stephany suggests, use a format string, that contains the proper padding.
When using padding as Stephany shows, I would not use vbTab (as the padding
gives that to you). Normally I move the format itself to a constant,
something like:
Const formatLine As String = "{0,-16} {1}"
Console.Writeline(formatLine, "test1:", v_test1.Trim)
Console.Writeline(formatLine, "test2long:", v_test2.Trim)
For details on the format string see:
http://msdn.microsoft.com/library/de...ttingtypes.asp http://msdn.microsoft.com/library/de...formatting.asp
Alternatively you can use String.PadLeft & String.PadRight to pad the
"label" to the respective # of spaces.
--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -
http://www.tsbradley.net
"James" <jk****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
| vb.net 2003
|
| i used console.writeline to output to screen.
|
| eg
| console.writeline ("test1 : " & vbtab & v_test1)
| console.writeline ("test2 : " & vbtab & v_test2)
| etc etc
|
| result becomes
| test1: <tab> result1
| test2: <tab> <tab> results2
|
| Although i used a single vbtab , the results is "mis-aligned" because it
| depends on v_test1 and v_test2 strings of characters.
|
| What is the best way to put into console.writeline such that i can
| pre-defined all vbtabs for best alighment ?
|
| I prefer results to be like this in tabular format :
|
| test1 : result1
| test2: result2
| etc etc
|
|
|
|
|
|
|