Infosys interview question

Using Java 8 asked to write a program to modify the string