Wednesday, 2 October 2013

Find all occurrences of text that begin and end with 'x' in a String?

Find all occurrences of text that begin and end with 'x' in a String?

I am trying to parse a String that will contain custom fields that the
user can input, such as %time%, %color%, %anything% etc. I want to be able
to search a String and find all bits that begin and end with '%', and then
do what I want with them. How can I do this?
After I process the values I will make a new String using the processed
values.
The String might look like this - "cheese%time% five %date%%color% money"
And I will do stuff that will turn it into - "cheese11:30:31 five
2013-10-02blue money"

No comments:

Post a Comment