Samsung Electronics interview question

Write a program to remove a particular word from a string and output the final string. Mention prototype , and handle exceptions.