The requested page is not available for the requested platform. You are viewing the content for Default platform.
All docs
V19.1
19.1
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

CRR0049 - Environment.NewLine can be used

This analyzer identifies "\r\n" string values which can be converted to Environment.NewLine calls to improve code readability and portability.

public string MakeText(params string[] data) {
    string result = data[0];
    for (int i = 1; i < data.Length; i++)
        result += "\r\n" + data[i];
    return result;
}

To fix the issue, convert the "\r\n" string value to the Environment.NewLine call:

public string MakeText(params string[] data) {
    string result = data[0];
    for (int i = 1; i < data.Length; i++)
        result += Environment.NewLine + data[i];
    return result;
}

Call the Use Environment.NewLine refactoring to replace the "\r\n" string with an Environment.NewLine constant reference.