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 Quotation marks ("") when parsing

removing Quotation marks ("") when parsing

Scheduled Pinned Locked Moved C#
questiondatabasecomjsonhelp
5 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.
  • M Offline
    M Offline
    minnie mouse
    wrote on last edited by
    #1

    just need a little more help with my beginners project, please. I have a large file in the following CSV format "71415","535","200","5364564","0","0","0","0","0","0","0","0","0" I have used the code from this article by dave'O http://www.codeproject.com/cs/database/DataSetFrmDelimTxt.asp to place the data in a datagrid. Just wondering , What is the easiest way to strip out all the quotation marks during the parsing ? :confused: Any help would be appreciated, thanks in advance. Seem to be having problems as this character is used to denote a string.

    G 1 Reply Last reply
    0
    • M minnie mouse

      just need a little more help with my beginners project, please. I have a large file in the following CSV format "71415","535","200","5364564","0","0","0","0","0","0","0","0","0" I have used the code from this article by dave'O http://www.codeproject.com/cs/database/DataSetFrmDelimTxt.asp to place the data in a datagrid. Just wondering , What is the easiest way to strip out all the quotation marks during the parsing ? :confused: Any help would be appreciated, thanks in advance. Seem to be having problems as this character is used to denote a string.

      G Offline
      G Offline
      Graham Nimbley
      wrote on last edited by
      #2

      string input=....

      input=input.Replace('"','');

      Graham

      M 1 Reply Last reply
      0
      • G Graham Nimbley

        string input=....

        input=input.Replace('"','');

        Graham

        M Offline
        M Offline
        minnie mouse
        wrote on last edited by
        #3

        Thanks for that, my quotation marks are now all gone. Just a little confused though, does this mean that ' can be used to enclose a string , as well as " . Also does input=input.Replace('"',''); insert a blank space, or does it remove the character alltogether ? Thanks for the assistance with this.:)

        G 1 Reply Last reply
        0
        • M minnie mouse

          Thanks for that, my quotation marks are now all gone. Just a little confused though, does this mean that ' can be used to enclose a string , as well as " . Also does input=input.Replace('"',''); insert a blank space, or does it remove the character alltogether ? Thanks for the assistance with this.:)

          G Offline
          G Offline
          Graham Nimbley
          wrote on last edited by
          #4

          ' can only be used to store a single character of type char. E.g.

          char testChar='s';

          Regarding input=input.Replace('"',''); It takes in a string, returns a new string where all the occurances of the first parameter are replaced by the second parameter. So in this case '"' (representing double quote char) is replaced by '' (empty char). Graham. [Edit: Just noticing that it's quite hard to tell two single quotes '' from a double quote " with the default browser's font. :doh: ] -- modified at 17:46 Thursday 15th June, 2006

          M 1 Reply Last reply
          0
          • G Graham Nimbley

            ' can only be used to store a single character of type char. E.g.

            char testChar='s';

            Regarding input=input.Replace('"',''); It takes in a string, returns a new string where all the occurances of the first parameter are replaced by the second parameter. So in this case '"' (representing double quote char) is replaced by '' (empty char). Graham. [Edit: Just noticing that it's quite hard to tell two single quotes '' from a double quote " with the default browser's font. :doh: ] -- modified at 17:46 Thursday 15th June, 2006

            M Offline
            M Offline
            minnie mouse
            wrote on last edited by
            #5

            Thanks, " Persistance alone is omnipotent" (Calvin Cooolidge):cool:

            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