Comment Post Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 14, 2021 08:52 AM
I have some multiline text I for some reason do not seem to be able to split into parts.
My text is:
“506070
80”
let arr = multi.toString().split(" ");
console.log(arr) //["506070 80"]
Does anyone know how I can split this?
If i make real space in the multiline text it splits as expected.
Solved! Go to Solution.
Reply
1 Solution
Accepted Solutions
Solved
See Solution in Thread
Comment Post Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 14, 2021 09:09 AM
for anyone need to do the same I figured it out.
let arr = multi.replace(/(\r\n)|\r|\n/g, '\n').split(/\n+/g);
Reply
1 Reply 1
Solved
See Solution in Thread
Comment Post Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 14, 2021 09:09 AM
for anyone need to do the same I figured it out.
let arr = multi.replace(/(\r\n)|\r|\n/g, '\n').split(/\n+/g);
Reply