var cousinsString = 'Pauline Guillaume Clarisse', cousinsArray = cousinsString.split(' '); alert(cousinsString); alert(cousinsArray); var cousinsString_2 = cousinsArray.join('-'); alert(cousinsString_2);