Thema: String
Beiträge zum Thema "String"
| Prototype: String.reverse [Flash 8]Liefert einen String in umgekehrter Reihenfolge
String.prototype.reverse = function() {
return this.split("").reverse().join("");
}
ASSetPropFlags(String.prototype,"reverse",1,true);
|
| Prototype: String.uniqid [Flash 8]Erstellt eine eindeutige ID
Array.prototype.find = function(eingabe) {
return (this.toString().split(eingabe).length > 1);
}
String.uniqid = function(nr) {
var str = "", b = "";
for(var i=0;i<nr;i++) {
b = random(36).toString(36);
[...]
|
| Prototype: String.replace [Flash 8]Suchen und ersetzen
// #########################
// Für Flash MX:
// #########################
String.prototype.replace = function (s, j) {
return this.split(s).join(j);
}
ASSetPropFlags(String.prototype,"replace",1,true);
// #### [...]
|
| Prototype: String.toArray [Flash 8]Text in Array umwandeln
// Inspired by Madokan
String.prototype.toArray = function() {
return this.split("");
};
ASSetPropFlags(String.prototype,"toArray",1,true);
// Zuweisung
text = "flashhilfe.de";
liste = text.toArray();
[...]
|
| Prototype: String.shuffle [Flash 8]String in zufälliger Reihenfolge sortieren
String.prototype.shuffle = function() {
var str = "", temp_str = this.split("");
while(temp_str.length) {
str += temp_str.splice(random(temp_str.length),1);
}
return str;
}
[...]
|
| Prototype: String.dateToTimestamp [Flash 8]Wandelt ein Datum-String in Timestamp um
String.prototype.dateToTimestamp = function(lang) {
var temp_str = this.split("."), temp_str_2 = temp_str.split(":");
return new Date(int(temp_str_2)).getTime();
}
// Optional "en" Angabe für englisc [...]
| |
Flashhilfe.de Flash Platform Tipps & Tutorials Flash Platform Andere Programmiersprachen Jobangebote Diskussionen
Flashhilfe News
Regeln & Bedingungen
|