let str = '12×3÷4+6-9';
      // 按照 × ÷  + - 分割 使用正则的方式分割 加号是正则的关键字,使用[+]
      let strArr = str.split(/×|-|÷|[+]/);
      console.log(strArr); // ["12", "3", "4", "6", "9"]

参考链接:https://blog.csdn.net/qq_23350817/article/details/85275244

相关文章:

  • 2021-12-14
  • 2022-12-23
  • 2022-12-23
  • 2021-08-14
  • 2021-08-27
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-11
  • 2021-11-14
  • 2022-02-21
  • 2021-12-18
  • 2022-12-23
相关资源
相似解决方案