I have the following String (based on a CSV):
str = '234,23,"sdf,23", "sdf", 23-APR-21, "sd",,'
I only want to get the element at the 5th position.
So normally I just do str.split(",")[4] => '23-APR-21'
But now I get returned str.split(",")[4] => '"sdf"'
Since applying just ","
on the escaped part of the CSV returns already two parts. "sdf,23"
=> sdf and 23
How would you solve this without using a special CSV parser?