Hi Roi, Unfortunately, there is no method that does this directly, in the Java APIs. If you need to replace a "word" by another word in a any text string, one way is to use a StringTokenizer to take out all words (token) from your string, one at a time. Then build back that string from scratch, replacing the searched word by its replacement word. You can have sample code at: http://www.javaranch.com/ubb/Forum33/HTML/000518.html You run the SNR.java with a text file name, the searched word, and the replacement word, and it does the job without confusion. For example, say the text: I read one book this week. Book? Rather a good book! I found it at the bookstore. How many books(did you write?)... Then replace the word book with newspaper, you'll get the resulting text: I read one newspaper this week. Book? Rather a good newspaper! I found it at the bookstore. How many books(did you write?)... Notice that the resulting text kept "Book", "bookstore", and "books". This is strict word replacement. But you could change the program slightly. Goodbye
Barry's not gonna like this. Barry's not gonna like this one bit. What is Barry's deal with tiny ads?