js操作文章、字符串换行


操作前:

 

操作后:

 

 

第一步:

把中英文的逗号和顿号置换为 '\n’

support_unit = support_unit.replace(/,|,|、/g, '\n')
 
第二步:
 //为了使\n生效
    white-space: pre;

 

参考:https://blog.csdn.net/ccmedu/article/details/82021065


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM