Hi everyone, I am starting to start with stackoverflow.
If I have any errors in the question of this question, hope for me. :)
If my test string is 'One\nTwo\n\nFour',
I am using RegExp /(.)*\n/in JavaScript,
will match 'One\nTwo\n\n'not 'One\n', 'Two\n' and '\n'pending.
And I want to get the result 'One', 'Two', '' and 'Four'.
Thanks very much @Dalorzo for the answer.
'One\nTwo\n\nFour'.split(/\n/g) //outputs ["One", "Two", "", "Four"]
Husky source
share