Here's the answer --> http://www.javaprogrammingforums.com/java-theory-questions/19364-string-manipulation.html