1 var stringValue = "Lorem ipsum dolor sit amet, consectetur adipisicing elit";
2 var positions = new Array();
3 var pos = stringValue.indexOf("e");
4 
5 while (pos > -1) {
6     positions.push(pos);
7     pos = stringValue.indexOf("e", pos + 1);
8 }
9 console.log(positions);

相关文章:

  • 2021-08-21
  • 2022-02-28
  • 2022-12-23
  • 2021-12-31
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-20
  • 2022-01-04
  • 2021-10-26
  • 2021-11-20
相关资源
相似解决方案