0

How can I convert kebab-case string to camelCase

eg. "refresh-token" to "refreshToken"

raklos
  • 28,027
  • 60
  • 183
  • 301
  • 1
    Maybe you should first try something and then come back with specific code that does not work so we can help you. Because right now, it sounds like you want us to do your work for you. – Etienne de Martel Jul 27 '20 at 20:16
  • Does it have to be using a regular expression? With 25k point I would assume you should be able to easily find out by yourself. :P – Andrew Jul 27 '20 at 20:16
  • honenstly guys I googled it!, my google is broken! – raklos Jul 27 '20 at 20:20
  • 2
    No problem, hope the linked dupe helps you! Have a nice evening. – Heinzi Jul 27 '20 at 20:23
  • I also found this other question, the second answer uses a regex: https://stackoverflow.com/questions/57556471/convert-kebab-case-to-camelcase-javascript – Andrew Jul 27 '20 at 20:24
  • 2
    @Andrew: Nice find, that'd be `Regex.Replace(input, "-.", m => m.Value.ToUpper().Substring(1))` in C#. Maybe I'll just add that as an answer to that dupe... – Heinzi Jul 27 '20 at 20:29

0 Answers0