if you read what i wrote, or better yet just look at the code. you would see that it will always break at a comma wether it's in a quote or not.
I know. I read both. That was precisely my point: your posted code doesn't handle quoting. Whether that's an acceptable limitation is unclear, but not through any fault of yours. The spec itself in the OP was unclear.
at this point the "csv" portion of all this is tossed out the window. we are dealing with a string object and have zero reference to any csv formatting.
I don't understand what your point here is. Simply saying "CSV" as a format can be ambiguous. It might imply quoting is supported, or it might not. There is no definitive rule one way or the other. With no further definition or specification, it's impossible to determine a complete answer.
a string doesn't care about commas inside quotes. like i said before, if there is a comma it's gonna break, period paragraph.
Understood. It supports only unquoted CSV.
if anyone needs something different, then figure it out. im tired of people nit picking perfectly functioning code with good documentation to boot. i don't see anyone else posting any worthwhile code. if you can do better, then do it.
I was simply pointing out that it was unclear what "CSV" meant in the originally posted context (house, city, state, zip), which might differ from that in the actual data (city, country, GPS-coords).
I also pointed out that quoting may not be necessary in the city,country,GPS case, simply because I'm not aware of any cities or countries whose names contain embedded commas or newlines. If there are any, then they would lead to misparsed data.
One of the problems with poorly defined data, or outright mistakes like calling it "cvs", is that a correct and comprehensive solution can be ambiguous. For example, does the data contain any quoted fields? Does it contain any fields with embedded commas? Answer: It's unspecified. What should one do about it? Work to spec? Require clarification? Over-engineer (e.g. add full support for quoting)?
Your code works correctly when commas are purely delimiters that will never appear embedded in a field. It won't work correctly if a comma is embedded in a quoted field. But we don't know if that's a problem or not.
Since the initial spec was unclear, and actually changed between the 1st post and the example data, it is entirely possible that your posted code meets all the OP's requirements. It certainly qualifies as simple and working, which is an excellent starting point.