Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 90290

提取富文本内容

$
0
0

text = ‘<color=#000000>亲,你说不说?,<color=#000000>111’;
// text = ‘亲,你说不说?亲,你说不说?亲,你说不说?’;
const regex = /<color=#[0-9A-Za-z]{6,6}>/g;
let str = text.replace(regex,’’);
let textStr = str.replace(/</color>/g,’’);
console.log(‘textStr:’,textStr);

6 个帖 - 2 位参与者

阅读整个主题


Viewing all articles
Browse latest Browse all 90290

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>