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. 2 2833
"djc" <no***@nowhere.com> wrote in message
news:%2***************@TK2MSFTNGP04.phx.gbl... 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
will do. Thanks.
"Mythran" <ki********@hotmail.comREMOVETRAIL> wrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl... "djc" <no***@nowhere.com> wrote in message news:%2***************@TK2MSFTNGP04.phx.gbl... 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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Oz |
last post by:
This is long. Bear with me, as I will really go through all the convoluted
stuff that shows there is a problem with streams (at least when used to
redirect stdout).
The basic idea is that my...
|
by: Steven T. Hatton |
last post by:
OK, I take back the nasty stuff I said about printf. At least until I see a
similarly concise way of writing this using C++ formatters. I want to
convert the following to something I can put onto...
|
by: shawnk |
last post by:
Hello Everyone
How do you format format numbers right-justified using Console.WriteLine(), i.e
I need to line up numbers in vertical columns and the MSDN documentation is pretty poor
Here is the...
|
by: John Sutor |
last post by:
I need some code that, on each keyup event, will take all of the numbers
typed into the text box and format as they type to look like this
100
1,000
10,000
100,000
1,000,000
John S
|
by: Homer Simpson |
last post by:
Hi,
I'm looking for a way to format the output of my double value. For example,
the result of a calculation may be 12.3456789 but I want to display 12.346
(three decimal places of precision)....
|
by: Scott M. |
last post by:
Ok, this is driving me nuts...
I am using VS.NET 2003 and trying to take an item out of a row in a
loosely-typed dataset and place it in a label as a currency. As it is now,
I am getting my...
|
by: john coltrane |
last post by:
Is there way to create a formatted string in a similar that is similar to
sprintf?
The same for printing, printf?
C,D,E,F,G,N,X for currency, decimal, exponential, fixed, general, numerical,...
|
by: cj2 |
last post by:
pages = 1
pages.tostring gives me "1"
pages+1.tostring gives me "2.0"
Why did it add the ".0" on there? I was looking for "2" and this screws
me up.
Actually this is what I was doing. In...
|
by: thedsadude |
last post by:
Hello,
I'm launching a script as follows:
<code>
p = subprocess.Popen()
p.wait()
</code>
If p.py writes to sys.stdout, then it is shown on the console.
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |