Training
Module
Format alphanumeric data for presentation in C# - Training
Explore basic methods in C# to format alphanumeric data.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Special characters are commonly used to format code, file data, and program output. You might use the tab key to control spacing across a single line or apply a soft or hard line break to format multi-line data. Visual Studio interprets specific characters as line breaks or separators. The following table lists the recognized characters and their corresponding Unicode values:
Character | Description | Unicode value |
---|---|---|
CR LF | Carriage return plus Line feed | 000D plus 000A |
LF | Line feed | 000A |
NEL | Next line | 0085 |
LS | Line separator | 2028 |
PS | Paragraph separator | 2029 |
When you copy text from another file or application, Visual Studio maintains the original encoding and line break characters in the copied value. For example, text copied from a Notepad file and pasted into a Visual Studio file use the original settings applied in Notepad. If you open a file that has unrecognized line break characters, Visual Studio might prompt you for instructions to normalize the inconsistent characters. You might also need to specify the type of line breaks to apply to the imported data.
You can specify the type of line break characters to apply to your data with the Advanced Save Options dialog. Visual Studio applies your desired encoding when you save your project files:
The Advanced Save Options dialog is available when you select File > Save <filename> As. In the Save File As dialog, expand the Save dropdown list and select Save with Encoding:
You can also place the Advanced Save Options command directly on the File menu for quick access:
For more information, see Customize menus and toolbars.
Training
Module
Format alphanumeric data for presentation in C# - Training
Explore basic methods in C# to format alphanumeric data.