字符串操作-字符串查找

Benchmark created on


Setup

const str = 'hello world';

Test runner

Ready to run.

Testing in
TestOps/sec
indexOf方法查找
const index = str.indexOf('world');
ready
search方法查找
const index = str.search(/world/);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.