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. StreamReader

StreamReader

Scheduled Pinned Locked Moved C#
question
3 Posts 3 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
    StephenMcAllister
    wrote on last edited by
    #1

    I am reading in a stream from a file and the text being read in is like this. "\"ABBE0001\",\"ABBEY\",\"CHRISTOPHER\",\"\",\"\",\"MR\",\"\",\"453 772 576\",\"\",\"\",\"M\",\"24/11/1960\"" I want to remove all backslashes and quotes but when I use the replace it does not work. How can I remove the backslashes and quotes. Thanks. Stephen

    C M 2 Replies Last reply
    0
    • S StephenMcAllister

      I am reading in a stream from a file and the text being read in is like this. "\"ABBE0001\",\"ABBEY\",\"CHRISTOPHER\",\"\",\"\",\"MR\",\"\",\"453 772 576\",\"\",\"\",\"M\",\"24/11/1960\"" I want to remove all backslashes and quotes but when I use the replace it does not work. How can I remove the backslashes and quotes. Thanks. Stephen

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Did you put an @ in front of the string, and escape the quote, or did you escape the quote AND the slash ? "\\\"" or @"\""" is what you need 'It does not work' is kind of hard to fathom. The replace method works, but to know what you're doing wrong, we need more info on what you expect, and what you're getting. Christian Graus - Microsoft MVP - C++

      1 Reply Last reply
      0
      • S StephenMcAllister

        I am reading in a stream from a file and the text being read in is like this. "\"ABBE0001\",\"ABBEY\",\"CHRISTOPHER\",\"\",\"\",\"MR\",\"\",\"453 772 576\",\"\",\"\",\"M\",\"24/11/1960\"" I want to remove all backslashes and quotes but when I use the replace it does not work. How can I remove the backslashes and quotes. Thanks. Stephen

        M Offline
        M Offline
        MoustafaS
        wrote on last edited by
        #3

        StephenMcAllister wrote: when I use the replace it does not work Have you tried the StringBuilder class ?

        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