Hackerss.com is a community of amazing hackers

Hackerss is a community for developers, data scientitst, ethical hackers, hardware enthusiasts or any person that want to learn / share their knowledge of any aspect of digital technology.

Create account Log in

Posted on

Javascript Reemplazar guiones por espacios

//Reemplazar guiones por espacios

//function to replace dashes with spaces
function replaceDashes(str) {
  // return the string with dashes replaced by spaces
  return str.replace(/-/g, " ");

const result = replaceDashes("hello-world");

console.log(result); //hello world

Enter fullscreen mode Exit fullscreen mode

Top comments (0)