0

Given a string and a char, Add an underline before any instance of the char, case-insensitive; In case the char never appear in the string, append the char at end surrounded by ().
You can assume ASCII input, though the screenshot isn't.
Shortest code in each language wins.
Test cases
Search, S =>...