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...