I can do each of them using regex, but I'm unsure how to combine them into a single regex to achieve both.
For example, this is what I'd like to happen:
HELLO_THERE -> Hello There
Found this, but it does the opposite of what I want, it lowercases the first, when i'd like it to lower case everything AFTER the first:
function changeStr(string){
return string.replace(/(?:_| |\b)(\w)/g, function($1){return $1.toLowerCase().replace('_',' ');});
}
changeStr(HELLO_THERE) -> hELLO tHERE