Prototype: String.nreplace [Flash 8]
| Beiträge: 0 Registriert: Jun 2004
| 19.06.2004, 00:14
Das n-te Zeichen eines Strings wird durch übergebenes Zeichen ersetzt
Prototype:
ActionScript:1 2 3 4 5 | String.prototype.nreplace = function(pos, repchar)
{
return (this.substring(0, pos-1).concat(repchar, this.substring(pos, this.length)));
};
ASSetPropFlags(String.prototype, "nreplace", 1, true);
|
Beispiel Aufruf:
ActionScript:1 2 3 4 | var tmp = "Das est ein Test!!!";
trace(tmp.nreplace(5,"i"));
-> "Das ist ein Test!!!";
|
| |
| Ähnliche Beiträge zum Thema | |
|
Flashhilfe.de Flash Platform Tipps & Tutorials Flash Platform Andere Programmiersprachen Jobangebote Diskussionen
Flashhilfe News
Regeln & Bedingungen
|