Nice walkthrough, thanks for writing it up. I had to work out the opposite yesterday for nearly identical reasons. I wanted to get the key from dataset and make it kebab-cased.
I didn't consider adding a delimiter parameter or doing the reverse as you have. So I've tweaked my code after reading this.
No problem, Regex is so hard to read, go with whatever works for you. I was lucky enough to find a fairly decently tested Regex match and tweak it to suit my needs.
Thanks again, your post encouraged me to improve my scripts.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Nice walkthrough, thanks for writing it up. I had to work out the opposite yesterday for nearly identical reasons. I wanted to get the key from
datasetand make it kebab-cased.I didn't consider adding a delimiter parameter or doing the reverse as you have. So I've tweaked my code after reading this.
Gist: gist.github.com/sarcoma/9df7d82bcc...
Credit where credit is due, I based my conversion off of this gist: gist.github.com/nblackburn/875e6ff...
Yeah RegExp is a great approach. I omitted that. I think I should add it. Thanks for sharing this.
No problem, Regex is so hard to read, go with whatever works for you. I was lucky enough to find a fairly decently tested Regex match and tweak it to suit my needs.
Thanks again, your post encouraged me to improve my scripts.