// const message = [
// '<p>恭喜触圈画师<a href="https://www.chuoooo.cn/HomePage?id=656" target="_self"> ?阿咩 </a>获得本次百日打卡周奖励~奖金将会在1-3个工作日内打入账户。获奖之后,打卡旧作在下次周评选时,不会被重复计算哟~</p>',
// '<p>恭喜触圈画师<a href="https://chuoooo.cn/HomePage?id=202.html" target="_self">Yin.Fox</a>获得百日打卡周奖励~奖金将会在1-3个工作日内打入账户。获奖之后,打卡旧作在下次周评选时,不会被重复计算,所以都会有获奖机会。预祝宝子们假期快乐,但也不要忘记打卡哦~</p>',
// '<p>恭喜触圈画师<a href="https://chuoooo.cn/#/HomePage?id=202.html" target="_self">Yin.Fox</a>获得百日打卡周奖励~奖金将会在1-3个工作日内打入账户。获奖之后,打卡旧作在下次周评选时,不会被重复计算,所以都会有获奖机会。预祝宝子们假期快乐,但也不要忘记打卡哦~</p>',
// '恭喜触圈画师<a href="https://www.chuoooo.com/detailpage?id=5676"><font color="#1e90ff">◎晴人悠太</font></a>获得本次兔年新春服饰征集活动的奖励!奖金将会在1-3个工作日内打入账户。感谢小伙伴们的踊跃参与发布了如此多优秀高质量的原创作品!'
// ]
// const errUrl = [ 'https://chuoooo.cn/', 'https://www.chuoooo.cn/', 'https://www.chuoooo.com/']
// let newMSg = message.map((item, index) => {
// if (!!item.text && item.text.lastIndexOf('/#')) {
// item.text = item.text.replace('/#', '')
// }
// return item
// })
// let finaMsg = []
// newMSg.forEach((item, index) => {
// errUrl.forEach(itemE => {
// let newItem = item
// if (!!item.text && item.lastIndexOf(itemE) > -1) {
// newItem = item.replaceAll(itemE, 'https://chuoooo.com/')
// }
// finaMsg.push(newItem)
// })
// })
// console.log(finaMsg, 'finaMsg');
字符串replace
最新推荐文章于 2024-05-24 13:39:19 发布