formatting console app output

D

djc

before I dig into the visual studio docs looking for info on this I decided
to post here to hopefully get pointed in the right direction and maybe save
some some.

I am playing around with creating console programs. I want to create my own
tools and utilities, not full blown applications. However, even my small
tools may have a lot of output. I want to find out how I can format my
output nicely. For example, using nicely aligned columns.

The only thing that came to mind was just queuing all my output into one
string and adding tabs, spaces, etc... as I build the string and then just
make one call to console.writeline.

However, before I did that I wanted to check the huge collection of tools
available via the .net framework (1.1 and/or 2.0) to see what more
specialized classes may exist for this. Do any? Or do I just focus on the
string manipulating classes and do what I mentioned previously?

any input is appreciated. Thanks.
 
M

Mythran

djc said:
before I dig into the visual studio docs looking for info on this I
decided to post here to hopefully get pointed in the right direction and
maybe save some some.

I am playing around with creating console programs. I want to create my
own tools and utilities, not full blown applications. However, even my
small tools may have a lot of output. I want to find out how I can format
my output nicely. For example, using nicely aligned columns.

The only thing that came to mind was just queuing all my output into one
string and adding tabs, spaces, etc... as I build the string and then just
make one call to console.writeline.

However, before I did that I wanted to check the huge collection of tools
available via the .net framework (1.1 and/or 2.0) to see what more
specialized classes may exist for this. Do any? Or do I just focus on the
string manipulating classes and do what I mentioned previously?

any input is appreciated. Thanks.

Take a look at Console.WriteLine overloads. Ex:

Console.WriteLine("Blah : {0,-30} Testing: {1}", "boo", "bee");

HTH :)

Mythran
 
D

djc

will do. Thanks.

Mythran said:
Take a look at Console.WriteLine overloads. Ex:

Console.WriteLine("Blah : {0,-30} Testing: {1}", "boo", "bee");

HTH :)

Mythran
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top