Use Environment.NewLine
Purpose
Replaces the “\r\n” string with the Environment.NewLine property value.
Availability
Available when the cursor is in the “\r\n” string.
Not available when the “\r\n” string is a part of another string.
Usage
Place the caret in the “\r\n” string.
Note
The blinking cursor shows the caret’s position at which the Refactoring is available.
- Press the Ctrl + . or Ctrl + ~ shortcut to invoke the Code Actions menu.
- Select Use Environment.NewLine from the menu.
After execution, the Refactoring replaces the “\r\n” string with the Environment.NewLine property value.
See Also