Problem with String
-
Hello all, I have a little problem regarding a double quote. I wrote this filter, to weed out all invalid characters in an Excel sheet. It works fine, however my invalid character list is defined in a string array. One of the invalid characters is
"
string invalidChar = "' \` # "; string\[\] invChar = invalidChar.Split(' ');
How do I get
"
into the string as well ? kind regards, -
Hello all, I have a little problem regarding a double quote. I wrote this filter, to weed out all invalid characters in an Excel sheet. It works fine, however my invalid character list is defined in a string array. One of the invalid characters is
"
string invalidChar = "' \` # "; string\[\] invChar = invalidChar.Split(' ');
How do I get
"
into the string as well ? kind regards, -
Hello all, I have a little problem regarding a double quote. I wrote this filter, to weed out all invalid characters in an Excel sheet. It works fine, however my invalid character list is defined in a string array. One of the invalid characters is
"
string invalidChar = "' \` # "; string\[\] invChar = invalidChar.Split(' ');
How do I get
"
into the string as well ? kind regards, -
See above for the solution proposed by leppie, which will work, however I prefer:
string invalidChar = @"' ` "" # ";
string[] invChar = invalidChar.Split(' ');I find it more readable. Chris
Both option works , I tested it :) Thank you both
-
See above for the solution proposed by leppie, which will work, however I prefer:
string invalidChar = @"' ` "" # ";
string[] invChar = invalidChar.Split(' ');I find it more readable. Chris
If we are going for readable:
char[] invalidCharacters = { '"', ',', '$', '\'' };
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego. -
If we are going for readable:
char[] invalidCharacters = { '"', ',', '$', '\'' };
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.