czwartek, 21 lutego 2019

Programming exercise #1 - find every second and add new line

Recently, I found interesting topic on SO, about parsing string in JS.
The exercise is:
Create function, that takes a string and returns string. Every second word should have added new line character "\n".
For example
let stringToParse = `How good is have account on and create new posts`
let result = "How good
is have
account on
StackOverflow and
create new
posts

Please place your answer (in any language) in comments section.

Brak komentarzy:

Prze艣lij komentarz