In C# ,is there any similar to "vbCrLf" in visual basic ?

When I manipulate with a string , i dont know the way similar to "vbCrlf" in visual basic .

Please help me a little , thank you very much.Maybe its easy for many people here.




Answer this question

In C# ,is there any similar to "vbCrLf" in visual basic ?

  • MichelleMcKelvey

    You can also use "\r\n" or "\n", which will give you a new line. From the .NET online documentation:

    A string containing "\r\n" for non-Unix platforms, or a string containing "\n" for Unix platforms.


  • Bede

    Isnt System.Environment.NewLine platform agnostic

  • Kim9999

    System.Environment.NewLine

  • Sean B.

    ahh yeah. . . thats right. . . vbNewLine is platform agnostic . . . right

  • ssandu

    Actually, I can't find anywhere in the VB documentation that says it's platform agnostic - strange.

    David Anton
    www.tangiblesoftwaresolutions.com
    Instant C#: VB to C# Converter
    Instant VB: C# to VB Converter
    Instant C++: C# to C++ and VB to C++ Converter
    Instant J#: VB to J# Converter
    Clear VB: Cleans up VB code
    Clear C#: Cleans up C# code



  • protools

    I think that this is that you need. :)

    System.Environment.NewLine

  • AltheaGayle

    Blair Allen Stark wrote:
    System.Environment.NewLine

    Thank you indeed , it works !



  • Caleb T

    Yes, but vbCrLf isn't, so you may or may not want to convert vbCrLf to System.Environment.NewLine. It depends on what the context of the original vbCrLf.

    David Anton
    www.tangiblesoftwaresolutions.com
    Instant C#: VB to C# Converter
    Instant VB: C# to VB Converter
    Instant C++: C# to C++ and VB to C++ Converter
    Instant J#: VB to J# Converter
    Clear VB: Cleans up VB code
    Clear C#: Cleans up C# code



  • In C# ,is there any similar to "vbCrLf" in visual basic ?