I am trying to convert string to camelCase using first some letter(user). Example: useracting, here after user from the string next letter it should be like caps(userActing). How to do it in javascript.
var s = "useracting";
var newval = s.replace(/-./g, x=>x[1].toUpperCase());
alert(newval);//userActing
newval output should be like userActing
2
Answers
You can try using the callback function like the following way:
I have another solution.