I have a string for example like ” :)text :)text:) 🙂 word 🙁 ” i need append it in textbox(or somewhere else), with condition:
Instead of ‘:)’ ,’:-(‘, etc. need to call function which enter specific symbol
I thinck exists solution with Finite-state machine, but how implement it don’t know. Waiting for advises.
update: ” :)text :)text:) 🙂 word 🙁 ” => when we meet ‘:)’ wec all functions Smile(“:)”) and it display image on the textbox
update: i like idea with delegates and Regex.Replace. Can i when meet ‘:)’ send to the delegate parameter ‘:)’ and when meet ‘:(‘ other parameter.
update: Found solution with converting to char and comparing every symbol to ‘:)’ if is equal call smile(‘:)’)
You can use Regex.Replace with delegate where you can process matched input or you can simply use
string.Replacemethod.Updated:
you can do something like this:
replacedvariable will have “aaa case1 bbb case2 ccc” value after execution.