Bartek Nowak Bartek Nowak - 3 months ago 10
Java Question

Is there a way to ignore first symbol using BufferedReader

I try to get data in JSON format from url, but displayed data starts with [, is there any way to ignore first symbol using BufferedReader?

Code: http://pastebin.com/eGQGVPY3

Rob Rob
Answer

To skip characters, use the BufferedReader skip method:

reader = new BufferedReader(new InputStreamReader(url.openStream()));
reader.skip(1);

This will work at any point in the stream (not just at the beginning).

Comments