Java String Handling illusion?
-
hey Friends i am working on a project called find, replace TextField = Hello Saurav How Are You How Are You Doing Saurav Find What = Saurav Replace With = Gaurav all those 3 string must be get from user. or just tell me a string method tht replace a word from string to another string word
-
Answer:
TextField tf = new TextField("Hello Saurav How Are You How Are You Doing Saurav"); parent.add( tf ); String s = tf.getText(); s = s.replaceAll("Saurav", "Gaurav"); tf.setText( s ); parent.repaint();
Sourav S at Yahoo! Answers Visit the source
Other answers
You Should use Regular Expressions! if you mean Java Language Look At this tutorial: http://java.sun.com/docs/books/tutorial/essential/regex/ if you mean javascript: http://www.regular-expressions.info/javascriptexample.html
Related Q & A:
- How to Implement Gateway Service something similar to Oracle API gateway Using Java and Java based Open Source frameworks only?Best solution by Quora
- How to see if one string contains another string?Best solution by Stack Overflow
- How would you handle a special handling situation in the absence of any information or proper documentation?Best solution by answers.yahoo.com
- How to search for a particular string in a text file using java?Best solution by Stack Overflow
- Would a 2009 Ford Falcon FG be better handling than a 2009 Ford Taurus?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.