editing a string using BufferedReader in Java
- by pbs
Exception handling aside, I'm using the following to input a line of text in Java:
BufferedReader strin = new BufferedReader(new InputStreamReader(System.in));
String txt = null;
txt = strin.readLine();
However, I want to be able to edit an existing string, so that if txt were initialized to "hello" instead of null, then the readLine() would have the "hello" text in the buffer for me to edit.
I can't see how to do this. Any help would be appreciated.