RosettaCodeData/Task/Reverse-words-in-a-string/R/reverse-words-in-a-string-2.r
2023-07-01 13:44:08 -04:00

3 lines
125 B
R

> `{` <- function(s) rev(unlist(strsplit(s, " ")))
> {"one two three four five"}
[1] "five" "four" "three" "two" "one"