# Search and Replace

**URL:** <https://forum.kirupa.com/t/search-and-replace/164149>\
**Category:** flash\
**Created:** [September 28, 2005, 9:01pm UTC](https://forum.kirupa.com/t/search-and-replace/164149 "2005-09-28T21:01:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpelland](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@mpelland](https://forum.kirupa.com/u/mpelland)\
**Post date:** [September 28, 2005, 9:01pm UTC](https://forum.kirupa.com/t/search-and-replace/164149/1 "2005-09-28T21:01:20Z")

</div>

hey,  
i am looking to create something similar to the str\_replace function (from PHP) that will replace all occurrences of the search string the replacement string from within an larger string. Does anyone have something like that created already (save me the time)?

ie  
var myStr:String = new String( “i wish i were an oscar meyer weiner” );  
var myOutput = str\_replace(myStr, “i”, “we”);

// myOutput would now = “we wish we were an oscar meyer weiner”
