[Home]KataDictionaryReplacer

FrontPage | RecentChanges | Preferences

This kata is about making a simple string replacer. It is inspired by Corey Haines Lightning talk about practicing. (aac2009.confreaks.com/06-feb-2009-20-30-lightning-talk-under-your-fingers-corey-haines.html)

Create a method that takes a string and a dictionary, and replaces every key in the dictionary pre and suffixed with a dollar sign, with the corresponding value from the Dictionary.

Tests

input : "", dict empty, output:""

input : "$temp$", dict ["temp", "temporary"], output: "temporary"

input : "$temp$ here comes the name $name$", dict ["temp", "temporary"] ["name", "John Doe"], output : "temporary here comes the name John Doe" [logo design] and [criação de sites] and [desenvolvimento de site] and [Unhas] and [Esmaltes] and [Tokio Hotel] and [Tokio Hotel Magazine] and [Escola de Surf] and [Web site e Home page] and [Portal] and [Loja Virtual] and [ipod nano 8gb] and [E-Commerce] and [Hotsite em Flash] and [Integração com Cielo] and [yellow box shoes] and [Configuração Google-Mini] and [Sistemas Web] and [Sistemas CRM e ERP] and [Camisetas] and [Tshirt]


FrontPage | RecentChanges | Preferences
Edit text of this page | View other revisions
Last edited August 30, 2010 2:03 pm by user-ip-134-91-33-89-sel.rdsnav.ro (diff)
Search: