arrays - How to split string by character with exceptions (Java) -
i want process csv file. there problems processing it:
i need split lines every ; i'd use .split method btu in case there exceptions:
a line can have empty "cells" x;y;z;;a;;;b
still need empty ones in array. example
array[0] = "x"; array[1] = "y"; array[2] = "z"; array[3] = "";
and on. exception is: there 1 cell contains html code (which has ";" in it). string shouldn't split if ; between "". there way handle this?
parsing data of form common problem, , has been solved csv parsers. use apache commons csv , change delimiter ;
instead of default ,
.