removing Quotation marks ("") when parsing
-
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.
-
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.
string input=....
input=input.Replace('"','');
Graham
-
string input=....
input=input.Replace('"','');
Graham
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.:)
-
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.:)
' 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 -
' 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, 2006Thanks, " Persistance alone is omnipotent" (Calvin Cooolidge):cool: