Вопрос

I know that when you want to parse a CSV file you use:

CSVReader reader = new CSVReader(new FileReader(csvPath));

But what about when you have a String csv; and you want to parse from that instead?

Это было полезно?

Решение

You can use the same constructor:

CSVReader reader = new CSVReader(new StringReader("one,two,three"));

Другие советы

Use a StringReader to read from a String.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top