Subtract a string in R -
i have string this:
phrase <- "this_is.//the_first?the_second"
and result want subtract string based on ? , take result this
>phrase_new[1] "this_is.//the_first?" >phrase_new[2] "the_second"
i try not working. please there idea this?
phrase_new <- sub("[:?:]", "", phrase)
if want split character, better use strsplit
:
> strsplit(phrase, "?", fixed = true) [[1]] [1] "this_is.//the_first" "the_second"
Comments
Post a Comment