How can I convert a string either like 'helloThere' or 'HelloThere' to 'Hello There' in JavaScript?
const text = 'helloThereMister'; const result = text.replace(/([A-Z])/g, " $1"); const finalResult = result.charAt(0).toUpperCase() + result.slice(1); console.log(finalResult);
1.4m articles
1.4m replys
5 comments
57.0k users