Yes, the base package in R includes the functions startsWith() and endsWith().
Usage:
> startsWith("Hello World", "Hello")
[1] TRUE
> endsWith("Hello World", "World")
[1] TRUE
If you want to explore more in R programming then watch this R programming tutorial for beginner: