问题
Can anybody please tell me what its checking in following condition.
if (s.IndexOfAny("\",\x0A\x0D".ToCharArray()) > -1)
回答1:
It's checking if there is any Quotation Mark ", Comma ,, a Line Feed \x0A or Carriage Return \x0D in the string s.
\x0A is the escaped hexadecimal Line Feed. The equivalent of \n.\x0D is the escaped hexadecimal Carriage Return. The equivalent of \r.
回答2:
\x0A\x0D are escaped hexadecimal carriage return and line feed characters.
来源:https://stackoverflow.com/questions/9021649/what-x0a-x0d-code-does-in-c-sharp-while-writing-csv