Create a functiondecipherMessage
that takes a single string parameter, codedMessage. The function should follow these steps,
- Find all words in the coded message that start with 'XC' and end with 'QT' and has exactly 3 numbers in it.
- Find all words in the codedMessage that:
- Start with the prefix ‘XC’.
- End with the suffix ‘QT’.
- Contain exactly 3 digits anywhere in the word.
- For each word that matches the criteria:
- Remove the ‘XC’ prefix.
- Remove the ‘QT’ suffix.
- Remove all digits.
- Join the transformed words together to form a new sentence, with each word separated by a space.
- Display the resulting sentence on the console.