Basic and quoted fields
Input
split_csv_row('"Smith, John",30,Engineer')
Output
['Smith, John', '30', 'Engineer']
The first field is quoted and contains a comma; quotes are removed. Other fields are unquoted and trimmed.
Full lesson preview
Parse a single CSV row into its constituent fields handling quoted fields and escaped quotes.
Problem statement
Task
Examples
Input
split_csv_row('"Smith, John",30,Engineer')
Output
['Smith, John', '30', 'Engineer']
The first field is quoted and contains a comma; quotes are removed. Other fields are unquoted and trimmed.
Input format
Output format
Constraints
Samples
Input
split_csv_row('a,b,c')
Output
['a', 'b', 'c']
Simple comma-separated fields.