regexp
im trying remove(technically condensing) duplicated strings
var str:string = actionloader.data;(lets pretend reads <break><break><break>hello)
var mypattern:regexp = /<break><break><break>/g;
str.replace(mypattern, "<break>")
var mypattern:regexp = /<break><break>/g;
str.replace(mypattern, "<break>")
trace("actionloader.data=["+str+"]");
i guess dont understand regexp because made since me until tried it
also tried word break without <> incase sort of escape string nonsense
and tried tinkering qouting area between /"forwardslashes"/
to no avail string remain unmodified,anyone know i've done wrong?
thanks
the replace method returns new string, not modify string acts upon.
try:
var mypattern:regexp = /<break><break><break>/g;
trace(str.replace(mypattern, "<break>"));
or reassign string processing of method, in...
var mypattern:regexp = /<break><break><break>/g;
str = str.replace(mypattern, "<break>"));
in case thinking off @ end, in none of show changing value of actionloader.data
More discussions in ActionScript 3
adobe
Comments
Post a Comment