# Text filtration

**URL:** <https://forum.kirupa.com/t/text-filtration/268658>\
**Category:** flash\
**Created:** [August 16, 2008, 9:41pm UTC](https://forum.kirupa.com/t/text-filtration/268658 "2008-08-16T21:41:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![saxx](https://avatars.discourse-cdn.com/v4/letter/s/f04885/32.png) [@saxx](https://forum.kirupa.com/u/saxx)\
**Post date:** [August 16, 2008, 9:41pm UTC](https://forum.kirupa.com/t/text-filtration/268658/1 "2008-08-16T21:41:52Z")

</div>

How? I’ve googled to death and the only stuff i see is ‘text filters’ as in it filters the text with blur filters and such. but if i want to replace certain characters, then what?

edit

Nevermind i was searching the wrong stuff

> var message:String = “My %s lives with %s in a %s.”;  
> var params:Array = [“cat”, “me”, “house”]

var i:int = -1;  
var n:int = params.length;  
var pattern:RegExp;

while ( ++ i \< n )  
{  
pattern = new RegExp( “%s”, “s” );  
message = message.replace( pattern, params[i] );  
}
