www.baidu.com —> baidu

用字符串属性做提取

let str = 'www.baidu.com'

str.search('baidu')

str.replace('www.', '')
str.replace('.com', '')
发布了23 篇原创文章 · 获赞 0 · 访问量 558

猜你喜欢

转载自blog.csdn.net/JIANLI0123/article/details/104520743