Open this example in the interactive library
Source code
console.log("hello world".replace(/\b\w/g, (c) => c.toUpperCase()));
Sample output
Hello World

Open this example in the interactive library
console.log("hello world".replace(/\b\w/g, (c) => c.toUpperCase()));
Hello World