I have a string:
"Community - Moderate Environment - Minor Financial - Major Health & Safety - Extreme "
I want to split this string into:
Community - Moderate
Environment - Minor
Financial - Major
Health & Safety - Extreme
its like give newline after one category,
how do I get that
I try to split:
var t = Community - Moderate Environment - Minor Financial - Major Health & Safety - Extreme
t.split('-')
after that I don't know what can I do
splitcreates an array. Do you actually want an array, or just a new string with newlines?Word1 - Word2 Word3 Word4 - Word5split into? It can either beWord1 - Word2 Word3andWord4 - Word5orWord1 - Word2andWord3 Word4 - Word5