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 ?

  • sdix401k

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

  • Devart Blake

    System.Environment.NewLine

  • dsandor_rtg

    I think that this is that you need. :)

    System.Environment.NewLine

  • mrbrown

    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



  • pbeash

    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.


  • Hintshigen

    Blair Allen Stark wrote:
    System.Environment.NewLine

    Thank you indeed , it works !



  • Jan Friberg

    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



  • Mimir

    Isnt System.Environment.NewLine platform agnostic

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