x <- c("str:split" , "new:string")
split <- sr.strsplit(x, sep = ":")
## split has the value:
##[[1]]:
##[1] "str" "split"
##
##[[2]]:
##[1] "new" "string"
split <- sr.strsplit(x, sep = ":", collapse = TRUE)
## split has the value:
## [,1] [,2]
##[1,] "str" "split"
##[2,] "new" "string"
y <- "str:split"
split <- sr.strsplit(y, sep = ":")
## split has the value:
##[1] "str" "split"Run the code above in your browser using DataLab