If you're coding with C++ then the solution would be:
if (userInput.find("darn") != -1) {
cout << "Censored" << endl;
}
else{
cout << userInput << endl;
}
Keep in mind that this will reject any input with the word "darn" in the sentence. This will not filter the word darn if the capitalization is in different formats like "Darn, dArn, daRn, darN, DARN".