R
Reactiflux

venus – 20-30 Aug 16

venus – 20-30 Aug 16

Vvenus8/16/2022
Hey. How can I split the string , so it won't throw any empty strings?
"First\nSecond\nThird\n\nFourth".split(`\n`);

["First", "Second", "Third", "", "Fourth"]; // Remove empty string
"First\nSecond\nThird\n\nFourth".split(`\n`);

["First", "Second", "Third", "", "Fourth"]; // Remove empty string
UUUnknown User8/16/2022
Message Not Public
Sign In & Join Server To View
Vvenus8/16/2022
I knew I can do it somehow using regex, but don't know the syntax. Thank you.
UUUnknown User8/16/2022
Message Not Public
Sign In & Join Server To View
Vvenus8/16/2022
this string is returned from an API, so I am unable to edit it, if you meant it that way
UUUnknown User8/16/2022
Message Not Public
Sign In & Join Server To View
Vvenus8/16/2022
Oh yea Thanks for the tip.
Gghardin1378/16/2022
alternatively you can just filter the resulting array
UUUnknown User8/17/2022
Message Not Public
Sign In & Join Server To View

Looking for more? Join the community!

R
Reactiflux

venus – 20-30 Aug 16

Join Server