Saturday, June 18, 2011

Flex doesn’t have a String.replaceAll()?

No, it does not. It does, however, have a pretty powerful regex parser, so instead of “myString.replaceAll(‘,’,’ ‘)” I can do a “myString.replace(/,/g, ” “)“. It is definitely a one-liner to use a global regex, but its not intuitively obvious.. and while coding a useless while loop, I looked over the API one more time and saw how easy it could be solved. :P

No comments:

Post a Comment