eQ Technologic interview question

Replace a given word from a sentence without using any in-built function in Java