문제

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