← 返回 stripe 的题目列表Debug: CSV Parsing Drops Quotes
类型:online_judge
Debug CSV parsing — quotes are dropped
You maintain Java CSV parsing code. It is reported that when fields contain quotes or when the raw quotes must be preserved, the parser “drops the quotes” or mishandles escaping (e.g., parsing "a" as a, or incorrect behavior for fields containing commas/newlines).
Tasks
Inspect the provided CSV parsing code and failing cases to identify why quotes/escaping are handled incorrectly.
Fix it to conform to RFC 4180 (or the CSV rules specified in the interview).
Provide at least 5 regression-test input lines (plain fields, comma in quotes, embedded double-quotes, empty field, trailing comma, newline inside quoted field) and the expected parsed output arrays.