split text and join in js

Solutions on MaxInterview for split text and join in js by the best coders in the world

showing results for - "split text and join in js"
Ryan
12 Feb 2019
1const myText = "It is a long established fact that a reader will"
2const newText = myText.split(" ").join("-")
3console.log(newText);//It-is-a-long-established-fact-that-a-reader-will