Qualcuno sa dirmi perchè questa funzione non funziona?

function tovirgola(stringa){
stringa=stringa.replace(/./gi,",");
return stringa;
}