I currently have this bit of code to split up a string and display it as a list.
<span className="reply">{this.props.message.split("\n").map((chunk) => {
return <span className="message-chunk">{chunk}<br /></span>
})}
I want to skip the first and last element in the split array because the string is of the form.
Heading\n
List Item\n
List Item\n
List Item\n
Ending\n
Is there a way to do this while using the map function. I saw mention of the filter() function in another related question but I don't think that's applicable here. Any help is appreciated.