_.endsWith(检测结尾字符串)
语法:
_.endsWith([string=''], [target], [position=string.length])源代码链接:source
npm包链接:npm package
描述:
检查字符串string是否以给定的target字符串结尾。
开始版本:3.0.0
参数:
[string=''] (string): 要检索的字符串。[target] (string): 要检索字符。[position=string.length] (number): 检索的位置。 返回值:(boolean): 如果字符串string以target字符串结尾,那么返回 true,否则返回 false。
例子:
_.endsWith('abc', 'c');
// => true
_.endsWith('abc', 'b');
// => false
_.endsWith('abc', 'b', 2);
// => trueLast updated
Was this helpful?