RosettaCodeData/Task/Reverse-a-string/R/reverse-a-string-2.r

2 lines
70 B
R

revstring <- function(s) paste(rev(strsplit(s,"")[[1]]),collapse="")