A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Can you optimize this replace code?

Threaded View

  1. #1
    Bob (the singing sock)
    Join Date
    Aug 2000
    Location
    Århus, Denmark
    Posts
    472

    Can you optimize this replace code?

    String.prototype.replace = function() {
    str = this
    str=str.split("Š").join("*");
    str=str.split("š").join("š");
    str=str.split("œ").join("œ");
    str=str.split("ž").join("ž");
    str=str.split("Ÿ").join("Ÿ");
    str=str.split("¢").join("¢");
    str=str.split("¥").join("¥");
    str=str.split("À").join("À");
    str=str.split("Á").join("Á");
    str=str.split("Â").join("Â");
    str=str.split("Ã").join("Ã");
    str=str.split("Ä").join("Ä");
    [about 200 more characters ... ]
    return str;
    }
    Don't ask me how we landed on this crappy solution ...
    If you have an idea on how to optimize the code at you will make a lot of poor processors very happy

    Regards
    POD
    Last edited by podenphant; 11-20-2003 at 11:26 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center