languages | products | page_type | name | urlFragment | description | ||
---|---|---|---|---|---|---|---|
|
|
sample |
String.Format examples |
string-format |
A .NET Core console application that contains different examples of using the String.Format method overloads. |
This sample code is a .NET Core console application written in C#. It presents numbered options to the user that correspond to different string formatting examples.
This sample is written in C# and targets .NET Core 3.1. It requires the .NET Core 3.1 SDK.
The source code includes an MSBuild project file for C# (a .csproj file) that targets .NET Core 3.1. After you download the .zip file containing the example code, create a directory and select Download ZIP to download the sample code files to your computer.
To build the sample:
- Download the .zip file.
- Extrat the files in the .zip file to a directory of your choice.
- If you're using Visual Studio 2019:
- In Visual Studio, select Open a project or solution on the Start page. Or, select File > Open > Project/Solution from the top menu.
- Select Debug > Start Debugging from the top menu to build and launch the application.
- If you're working from the command line:
- Navigate to the directory that contains the sample.
- Enter the command
dotnet run
to build and launch the application.