Topic: Array operations
Per a discussion from here:
http://ketarin.canneverbe.com/forum/vie
php?id=150
I'd really find it useful to be able to perform mass replacements on a variable by passing in an array of "find" and an array of "replace" values. This would work something like this:
{myvar:arrayreplace:,:Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec:01,02,03,04,05,06,07,08,09,10,11,12}Where "arrayreplace" is the function name, "," is the delimiter, "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec" is the find array, and "01,02,03,04,05,06,07,08,09,10,11,12" is the replacement array.
{myvar:arrayreplace:delimiter:findarray:replacearray}Pushing that against the following values would yield these respective results:
2010-May-08 = 2010-05-08
Dec 11, 2004 = 12 11, 2004
I hate June bugs = I hate 06e bugs
Here's another place it would come in handy:
{myvar:arrayreplace:|:, Build| Build | part | beta | b:.|.|.|.|-}This would convert:
Picasa 3.6, Build 3622 = Picasa 3.6.3622
Audacity 1.3 beta 22 = Audacity 1.3.22
MyApp 2.9 b4 = MyApp 2.9-4
Last edited by shawn (2010-05-30 20:15:24)