Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

use of split and join

/* split methods splits string object into array of strings  
and join method changes element of array into a string */
const name= "Shirshak Kandel"
const nameWithDash=name.split(" ").join("-")
console.log(nameWithDash);//Shirshak-kandel
 
PREVIOUS NEXT
Tagged: #split #join
ADD COMMENT
Topic
Name
5+1 =