Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on Replace a word in a string with given word within the Java forums, part of the Software Development category; Any one can write the logic for a String is given "this is string" and repalce the word "is" by 'was" and the resultant string be "this was string" and ...
|
|||||||
|
|||
|
Replace a word in a string with given word
Any one can write the logic for a String is given "this is string" and repalce the word "is" by 'was" and the resultant string be "this was string" and the final string would be palced in same variable.
How can we replace a word in a string with given word? |
| The Following User Says Thank You to naggeek For This Useful Post: | ||
| Sponsored Links |
|
|||
|
Re: Replace a word in a string with given word
Quote:
StringBuffer str = new StringBuffer("this is string"); str.replace(5, 7, "was"); and then print it |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| what is the word ? | psuresh1982 | Brainteasers | 11 | 01-17-2007 07:10 AM |
| which word fits here? | vmshenoy | Brainteasers | 7 | 01-12-2007 08:10 AM |
| english word.... | psuresh1982 | Brainteasers | 5 | 12-14-2006 02:35 AM |
| Spell the Word | janelyn | Brainteasers | 3 | 09-16-2006 03:23 PM |
| Find out the odd word | Remasri | Brainteasers | 1 | 08-23-2006 04:57 PM |