Does R have function startswith or endswith like python? [closed]
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 years ago . The question is very clear in the title. 回答1: As added to base in 3.3.0, startsWith (and endsWith ) are exactly this. > startsWith("what", "wha") [1] TRUE > startsWith("what", "ha") [1] FALSE https://stat.ethz.ch/R-manual/R-devel/library/base/html/startsWith.html 回答2: Not inbuilt like that. Options