VB.NET split on new lines (C# conversion)

前端 未结 3 1075
别跟我提以往
别跟我提以往 2021-01-05 02:30

I\'m trying to convert this code from C# to VB.NET

string[] lines = theText.Split(new string[] { \"\\r\\n\", \"\\n\" }, StringSplitOptions.None);
         


        
3条回答
  •  南笙
    南笙 (楼主)
    2021-01-05 03:15

    From an online converter:

    Your c# code:

    string[] lines = theText.Split(new string[] { "\r\n", "\n" }, StringSplitOptions.None);

    Converted to VB.NET:

    Dim lines As String() = theText.Split(New String() {vbCr & vbLf, vbLf}, StringSplitOptions.None)
    

提交回复
热议问题