I have a question about my javascript.
i have something retrieved from my DB like this:
lots of texts in line 1
lots of texts in line 2
lots of texts in line 3
lots of texts in line 4
I want to create an array and create elements based on the breakline.
I have something like
var contents = obj.string //obj.string contains the contents above.
contents = contents.split(/(\r\n|\r|\n)/g)
It created more than 4 elements because some elements are just a 'breakline
'.
Can anyone help me to get just 4 elements? Thanks so much!