end-with

2019-04-12 admin

end-with是什么

什么是end-with,Determines whether a string ends with the characters of another string.

end-with使用教程帮助文档

end-with <sup>Version Badge</sup>

Determines whether a string ends with the characters of another string.

ES2015 String#endsWith() ponyfill.

MIT License

build:? coverage:?

Install

$ npm install --save end-with 

Usage

For more use-cases see the tests

var endWith = require('end-with');

endWith('abcde', 'e');  // => true
endWith('abcde', 'de'); // => true
endWith('abcde', 'bc'); // => false
endWith('abcde', '');   // => true
endWith('abcde');       // => false
endWith('abcde', null); // => false

Related

  • start-with - Determines whether a string begins with the characters of another string.
  • pad-start - ES spec-compliant String.prototype.padStart shim.
  • pad-end - ES spec-compliant String.prototype.padEnd shim.

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-61565.html

文章标题:end-with

回到顶部