Carriage Return in C#


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Carriage Return in C#

  1. #1
    Join Date
    Dec 2003
    Location
    Italy
    Posts
    250

    Carriage Return in C#

    Hi guys,
    What's the equivalent of VBCRLF in C# ?

    Thank you all

  2. #2
    Join Date
    Dec 2003
    Posts
    2,750
    Either Environment.NewLine or "\r\n" should work.
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

  3. #3
    Join Date
    Dec 2003
    Location
    Italy
    Posts
    250

    Carriage Return in C# ANOTHER QUESTION!

    Thnx Paul.
    One more question.... does C# has anythink like INSTR function ?

    Thank you again

  4. #4
    Join Date
    Dec 2003
    Posts
    2,750
    Just use the IndexOf method for the String class.
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

  5. #5
    Join Date
    Dec 2003
    Location
    Italy
    Posts
    250

    Carriage Return in C#

    Thnx again Paul, u r the best !

  6. #6
    Join Date
    Jul 2004
    Posts
    81
    Quote Originally Posted by pclement
    Either Environment.NewLine or "\r\n" should work.
    "\r\n" will be safer since it's absolutely certain to be equal to vbCrLf, while Environment.NewLine can *possibly* be different (I can't give the exceptions, but they are there).

    However, in new code it's nicer to use Environment.NewLine.
    David Anton
    Convert between VB, C#, C++, & Java
    www.tangiblesoftwaresolutions.com
    Instant C# - VB to C# Converter
    Instant VB - C# to VB Converter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center