Question: -- | Write a function, called greet, that takes a string representing a -- | persons name and says Hi to that person. --
-- | Write a function, called greet, that takes a string representing a
-- | persons name and says "Hi " to that person.
-- | There has to be only a single space between Hi and the person's name in the result string.
-- | There should not be any other spaces in the result string.
-- | There should not be any punctuation marks or any additional characters.
-- | If the name provided is empty, your function should return "Hi there".
-- -- >>> greet "Ann" -- "Hi Ann"
-- >>> greet "Peter" -- "Hi Peter"
-- >>> greet "" -- "Hi there"
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
