skip to main | skip to sidebar
Cloud Nebula

Wednesday, October 14, 2009

Great replaceAll in AS3

Simple and powerful. Found at:

http://snipplr.com/view/10998/replace-all/


var theContent:String = "Test String with lots of t's"
trace(replace(theContent, "t", "z"));

function replace(str:String, fnd:String, rpl:String):String{
return str.split(fnd).join(rpl);
}
Posted by Brian at 11:07 PM

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2011 (9)
    • ►  November (1)
    • ►  July (1)
    • ►  April (2)
    • ►  February (2)
    • ►  January (3)
  • ►  2010 (33)
    • ►  November (3)
    • ►  October (7)
    • ►  September (10)
    • ►  June (2)
    • ►  May (4)
    • ►  March (1)
    • ►  February (3)
    • ►  January (3)
  • ▼  2009 (26)
    • ►  December (1)
    • ►  November (1)
    • ▼  October (3)
      • Keylistener failing in Flex with creationComplete
      • AS3 writeUTF vs writeMultiByte with diacriticals, ...
      • Great replaceAll in AS3
    • ►  September (6)
    • ►  August (2)
    • ►  June (1)
    • ►  March (1)
    • ►  February (5)
    • ►  January (6)
  • ►  2008 (70)
    • ►  December (4)
    • ►  November (10)
    • ►  October (6)
    • ►  September (1)
    • ►  August (4)
    • ►  July (2)
    • ►  May (6)
    • ►  April (13)
    • ►  March (7)
    • ►  February (9)
    • ►  January (8)
  • ►  2007 (7)
    • ►  December (7)

About Me

My photo
Brian
View my complete profile