本文介绍了R是否具有像python一样的开头或结尾函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

> startsWith('abc', 'a')
[1] TRUE
> startsWith('abc', 'c')
[1] FALSE

> endsWith('abc', 'a')
[1] FALSE
> endsWith('abc', 'c')
[1] TRUE

推荐答案

在3.3.0 startsWith(和endsWith)中添加到base的过程就是这样.

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

这篇关于R是否具有像python一样的开头或结尾函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-16 14:00
查看更多