Visualizzazione dei risultati da 1 a 5 su 5

Discussione: Sostituzione carattere

  1. #1
    Utente di HTML.it L'avatar di PaoDJ
    Registrato dal
    Oct 2001
    Messaggi
    273

    Sostituzione carattere

    Ciao,

    come posso fare a sostituire in una variabile tutte le & con & ?

    Grazie
    Pao

  2. #2
    // 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)

  3. #3
    Utente di HTML.it L'avatar di PaoDJ
    Registrato dal
    Oct 2001
    Messaggi
    273
    con tutte le funzioni che ha, flash non ha il replace??

    Strano....

  4. #4
    Utente di HTML.it L'avatar di PaoDJ
    Registrato dal
    Oct 2001
    Messaggi
    273
    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)
    Non funziona!

  5. #5
    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"))

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.