what “\”,\x0A\x0D" code does in C# while writing CSV

99封情书 提交于 2020-07-18 09:14:07

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!