2011-09-15 19 views

Respuesta

47
"hello".split('').join(' '); // "h e l l o" 
+0

Es de destacar que no es necesario cualquier framework JS instalado para usar split() y join(). –

1
var text = "hello"; 
var betweenChars = ' '; // a space 

alert(text.split('').join(betweenChars)); 
3

intento:

var hello = 'hello'; 
var test = ''; 

for(var i=0; i<hello.length; i++){ 
    test += hello.charAt(i) + ' ';  
} 

alert(test); 
Cuestiones relacionadas