Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
9
Task/Substring/R/substring.r
Normal file
9
Task/Substring/R/substring.r
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
s <- "abcdefgh"
|
||||
n <- 2; m <- 2; char <- 'd'; chars <- 'cd'
|
||||
substring(s, n, n + m)
|
||||
substring(s, n)
|
||||
substring(s, 1, nchar(s)-1)
|
||||
indx <- which(strsplit(s, '')[[1]] %in% strsplit(char, '')[[1]])
|
||||
substring(s, indx, indx + m)
|
||||
indx <- which(strsplit(s, '')[[1]] %in% strsplit(chars, '')[[1]])[1]
|
||||
substring(s, indx, indx + m)
|
||||
Loading…
Add table
Add a link
Reference in a new issue