A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: how to do a string repplace

  1. #1

    how to do a string repplace

    Hi there,

    I need a simple string replace like php's str_replace('search_string', 'replace_string', 'string')

    i just cant work it out!!!
    Having a bad day? grinds-my-gears.com

    What i do

  2. #2
    Senior Member jbum's Avatar
    Join Date
    Feb 2004
    Los Angeles
    A method I commonly use (which works like a global string replace on the string) is:

    yourString.split( 'seachString' ).join( 'replaceString' );
    This was one of a collection of useful one-liners I posted here:


    For a one-shot search and replace you can use string.indexOf and splice it out...

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