Main menu

Recently I was working on an application and I was in a situation where I have to remove some specific words from a string. Words were in comma separated format. So I have written a function which gets two string parameters and return a string value. First parameter is the input string which I have to clean from some specific words and the second parameter is a comma separated string of words which I want to remove. In my situation, I have saved these words in database in comma separated format. I bring these words from database when I need to remove from a string. In my below code, I am skipping the step of getting these words from database. I am just showing the function where I am removing these words from a string. It doesn’t matter from where you are getting the input string and comma separated words, you just need to pass input string and comma separated words to call this function and get a clean string.