'How to include a special character in a text variable (in JS / app scripts)?

I am using a Google app script to automatically populate a team vacation calendar. It automatically adds events to the vacation calendar based on keywords. Here is how the keywords are defined:

let KEYWORDS = ['vacation', 'ooo', 'out of office', 'offline', 'holiday', 'holidays', 'out', 'C-Day'];

It works fine except for C-Day. (When someone creates an event named "C-Day" in their calendar it is not recognized by the script.)

I have tried 'C-Day', 'C\-Day', 'C-Day', 'C-Day', 'C&#\8\2\1\1;Day' and some variations on those without success.

This feels like a novice mistake on my part, but I can't figure it out. Any help is appreciated.

FYI - I am using these instructions... https://developers.google.com/apps-script/overview and copied/modified this AppScript project... https://script.google.com/home/projects/1jvPSSwJcuLzlDLDy2dr-qorjihiTNAW2H6B5k-dJxHjEPX6hMcNghzSh/edit



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source