JS - to remove all similar character from a string

0 votes
184 views
added Mar 18, 2022 in Javascript by lcjr First Warrant Officer (11,830 points)
edited Jul 25, 2022 by lcjr
const brandPath = path_arr[2];
// e.g lazacode-org
const brandName = brandPath.replace(/-/g,' ');

console.log(brandName);
// will output lazacode org

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...