| splitAndFetch | R Documentation | 
Function to split and fetch string components based on a specific delimiter
splitAndFetch(vec, delim, part)
| vec | character vector to apply splitting to | 
| delim | character specifying the delimitor to separate string by | 
| part | integer specifying the part to fetch after splitting | 
substring based on splitting criteria
Vinay Kartha
my_string <- c("This_is_random_string.111","Yes_it_is.222")
# Get first part splitting on _
splitAndFetch(vec=my_string,delim="_",part=1)
# Get first two parts splitting on _
splitAndFetch(vec=my_string,delim="_",part=1:2)
# Get second part splitting on .
splitAndFetch(vec=my_string,delim=".",part=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.