■
Source Code
The BasicConsoleIO project is located under the Chapter 3 subdirectory.
Formatting Numerical Data Beyond Console Applications
On a final note, be aware that the use of the .NET string formatting characters is not limited to con-
sole programs! This same formatting syntax can be used when calling the static string.Format()
method. This can be helpful when you need to compose textual data at runtime for use in any
application type (desktop GUI app, ASP.NET web app, XML web services, and so on).
By way of a quick example, assume you are building a graphical desktop application and need
to format a string for display in a message box:
void DisplayMessage()
{
Do'stlaringiz bilan baham: |