All Forums General
20 Apr 2015
How to find multiple occurrence of a word in a string if the number of occurrences of the word is not known

Hi All
I have a string as below
selectedProductList={"reservedProduct":[{" specialInstruction":"Enjoy the pet","unitPrice":135,"selectedOptions":[{"optionName": "color","optionValue":"black"},{"optionName":"size"," optionValue":"adult"},{"optionName":"Weeks"," optionValue":"one"}}
I need to get the values after optionName and optionValue
i.e for {"optionName":"color","optionValue":"black"} - I need to show color and black in my report.
But the number of occurrences of optionName and optionValue words are not known

yuvaevergreen 93 posts Joined 07/09
27 Apr 2015

Recursive can be useful.

You must sign in to leave a comment.