Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Removing CR-LF's from a string using Regex

Removing CR-LF's from a string using Regex

Scheduled Pinned Locked Moved C#
regexcsharp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sultan_of_6string
    wrote on last edited by
    #1

    Hi! I've got these strings that have \r\n's in them. I wanted to know if there is a way to remove them from the string using the .NET regular expression engine, instead of StringBuilder. Thanks and sorry about the double-post.

    L 1 Reply Last reply
    0
    • S sultan_of_6string

      Hi! I've got these strings that have \r\n's in them. I wanted to know if there is a way to remove them from the string using the .NET regular expression engine, instead of StringBuilder. Thanks and sorry about the double-post.

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      Hi, wouldn't a string.Replace("\r\n", "") work? :) READ MSDN

      S 1 Reply Last reply
      0
      • L leppie

        Hi, wouldn't a string.Replace("\r\n", "") work? :) READ MSDN

        S Offline
        S Offline
        sultan_of_6string
        wrote on last edited by
        #3

        Whoa! So easy! Thanks a lot. I was doing something really wierd.

        L 1 Reply Last reply
        0
        • S sultan_of_6string

          Whoa! So easy! Thanks a lot. I was doing something really wierd.

          L Offline
          L Offline
          leppie
          wrote on last edited by
          #4

          Thats why I have not ventured in Regex Land :) But I have to now, strings are just getting too complicated. READ MSDN

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups