PEOL interview question

Coding: Write a program to replace a word in a sentence without using inbuilt methods.