Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
7
Task/Reverse-a-string/R/reverse-a-string-1.r
Normal file
7
Task/Reverse-a-string/R/reverse-a-string-1.r
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
revstring <- function(stringtorev) {
|
||||
return(
|
||||
paste(
|
||||
strsplit(stringtorev,"")[[1]][nchar(stringtorev):1]
|
||||
,collapse="")
|
||||
)
|
||||
}
|
||||
1
Task/Reverse-a-string/R/reverse-a-string-2.r
Normal file
1
Task/Reverse-a-string/R/reverse-a-string-2.r
Normal file
|
|
@ -0,0 +1 @@
|
|||
revstring <- function(s) paste(rev(strsplit(s,"")[[1]]),collapse="")
|
||||
4
Task/Reverse-a-string/R/reverse-a-string-3.r
Normal file
4
Task/Reverse-a-string/R/reverse-a-string-3.r
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
revstring("asdf")
|
||||
revstring("m\u00f8\u00f8se")
|
||||
Encoding("m\u00f8\u00f8se") # just to check if on your system it's something
|
||||
# different!
|
||||
Loading…
Add table
Add a link
Reference in a new issue