Hello all,
I am retrieving data from servlet to midlet. Now coming data is whole string. but now I want to chop it into different words. here my code is :
HttpConnection conn = (HttpConnection) Connector.open(url);
StringBuffer sb = new StringBuffer();
conn.setRequestMethod(HttpConnection.GET);
conn.setRequestProperty("Content-Type", "Application/x-urlformencoded");
InputStream is = conn.openInputStream();
byte[] b = new byte[(int) conn.getLength()];
int ch = 0;
while ((ch = is.read()) != -1) {
sb.append((char) ch);
}
System.out.println(sb);
and the output is
LG
WIPRO
VIDEOCON
DELL
HP
COMPAQ
But now I want each word and append them into list. What can I do?