Ciao,
come posso fare a sostituire in una variabile tutte le & con & ?
Grazie
Pao
Ciao,
come posso fare a sostituire in una variabile tutte le & con & ?
Grazie
Pao
// replace all occurrences of strng with rep in a string
String.prototype.replace = function (strng, rep) {
var temparray = this.split(strng);
return temparray.join(rep);
}
(http://proto.layer51.com/d.aspx?f=17)
con tutte le funzioni che ha, flash non ha il replace??
Strano....
Non funziona!Originariamente inviato da Broly
// replace all occurrences of strng with rep in a string
String.prototype.replace = function (strng, rep) {
var temparray = this.split(strng);
return temparray.join(rep);
}
(http://proto.layer51.com/d.aspx?f=17)
L'hai richiamata con la sintassi giusta?
Esempio
// replace all occurrences of strng with rep in a string
String.prototype.replace = function (strng, rep) {
var temparray = this.split(strng);
return temparray.join(rep);
}
k = "Ciao & mondo &"
trace(k.replace("&","p"))