Hello everyone, i’m so confused about the “Spinal tap Case” Challenge, in the intermediate algorithms.
Here is where I have trouble in the code solution :
str = str.replace(/([a-z])([A-Z])/g, '$1 $2');
Why do we have to search for lowercase letters? why not only replacing the before of each capitalized letters by a whitespace?
And also why when we test the first char isn’t a blank space (since it should due to the [A-Z][a-z]) ?
I hope someone can help it took 3 days to this one and my code was so dirty that I looked for the clean solution …
I’m not good at regex I don’t know if it happen to some of you ?
Peace