@aloyschen
2017-09-30T09:01:54.000000Z
字数 368
阅读 99
CodeWars
Write a reverseWords function that accepts a string a parameter, and reverses each word in the string. Every space should stay, so you cannot use words from Prelude.
Example:
reverse_words("This is an example!") # returns "sihT si na !elpmaxe"
reverseWords "An example!" -- "nA !elpmaxe"
reverseWords "double spaces" -- "elbuod secaps"