icsharpcode / CodeConverter

Convert code from C# to VB.NET and vice versa using Roslyn
https://icsharpcode.github.io/CodeConverter/
MIT License
838 stars 218 forks source link

VB -> C#: Problem with vbNewLine #587

Closed ghost closed 4 years ago

ghost commented 4 years ago

Input code

    Public Function StartInfo() As String
        Dim tempString As String = ""
        tempString &= $"*UNIT{vbNewLine}{ForceUnit},{LenghtUnit},BTU,F"
        Return tempString
    End Function

Erroneous output

 public string StartInfo()
        {
            string tempString = "";
            tempString += $"*UNIT{Microsoft.VisualBasic.Constants.vbNewLine}{ForceUnit},{LenghtUnit},BTU,F";
            return tempString;
        }

Expected output

 public string StartInfo()
        {
            string tempString = "";
            tempString += $"*UNIT{Environment.NewLine}{ForceUnit},{LenghtUnit},BTU,F";
            return tempString;
        }

Details

GrahamTheCoder commented 4 years ago

Consolidating into #174 - I'll deal with a bunch of these together