Exclamation marks series #4: Remove all exclamation marks from sentence but ensure an exclamation mark at the end of string
Remove all exclamation marks from sentence but ensure an exclamation mark at the end of string. For a beginner kata, you can assume that the input data is always a non-empty string, no need to verify it.
"Hi!" ---> "Hi!"
"Hi!!!" ---> "Hi!"
"!Hi" ---> "Hi!"
"!Hi!" ---> "Hi!"
"Hi! Hi!" ---> "Hi Hi!"
"Hi" ---> "Hi!"