Skip to content
Advertisement

Split string with unexpected behaviour?

I am reading a csv file and I use a split on every line but I do not fully understand the behavior.

csv file:

JavaScript

code:

JavaScript

This yields:

JavaScript

but I expected the last line to be:

JavaScript

Advertisement

Answer

Use the delimiter arg to csv.reader to split on semicolons instead of commas:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement