View: ActionScript replace function

  1. 11 years ago by spirit
    1. function replace(str:String,find:String,replace:String):String
    2. {
    3.         var index:Number;
    4.         while(str.indexOf(find)!=-1)
    5.         {
    6.                 index= str.indexOf(find);
    7.                 str = str.substr(0,index) + replace + str.substr(index + find.length);
    8.         }
    9.         return str;
    10. }
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/685"></script>

0 comment about "ActionScript replace function"