ios - 一个关于字符串判断截取的需求
ringa_lee
ringa_lee 2017-04-17 15:55:00
0
4
304

假如我是 var s= "..........."

我的需求

  1. 标签内的内容替换成 其他内容

  2. 起始位置计算, 在整个字符串中的index 位置

ringa_lee
ringa_lee

ringa_lee

reply all (4)
大家讲道理

You can consider using regular expressions to process

    大家讲道理

    String.prototype.indexOf()
    String.prototype.substring()
    String.prototype.replace()

    The question owner can use the above method to solve the problem

      Ty80

      1 Use regular expression
      2 Use index of

        阿神
        s.replace(/]+)>/g, "新字符串")
          Latest Downloads
          More>
          Web Effects
          Website Source Code
          Website Materials
          Front End Template
          About us Disclaimer Sitemap
          php.cn:Public welfare online PHP training,Help PHP learners grow quickly!