Well, nobody is going to write that code for you, nor should they. Beside the fact that JavaRanch is NotACodeMill (<- click) this sort of thing is very important to master yourself. Especially considering the forum you posted this in. If you take a look at the String API, under Method Summary, you should be able to find a method that will allow you to do what you're looking for. Let's start by identifying that method.
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.