Split string with commas to new line

前端 未结 6 2158
终归单人心
终归单人心 2021-02-04 19:11

I have a string like

This is great day, tomorrow is a better day, the day after is a better day, the day after the day after that is the greatest day
         


        
6条回答
  •  萌比男神i
    2021-02-04 19:50

    > a = 'This is great day, tomorrow is a better day, the day after is a better day, the day after the day after that is the greatest day'
    > b = a.split(', ').join('\n')
    
    "This is great day
    tomorrow is a better day
    the day after is a better day
    the day after the day after that is the greatest day"
    

提交回复
热议问题