Posted By: jnox |
5/6/2006 7:15:00 AM |
Reply To: vandana who posted...
|
|
I can give you a simple example, here goes:
----------
String b = "Hello\nMotto\n!";
StringReader sr = new StringReader(b);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int ch = 0;
for (int i=1;i<=b.length() ;i++ ){
ch = sr.read();
if (ch!=10){ //value 10 is enter
//when you catch the character of enter, do what u have to do. In here, I put character into ByteArrayOutputStream.
baos.write(ch);
}
}
System.out.println(baos.toString());
----------
Have a nice try!
|
|