Solves task 7 replace substring