what “\”,\x0A\x0D" code does in C# while writing CSV
问题 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