URL Replacement

Aug 19 2014 6:51 AM
I need a solution for the following scenario.
I have two urls like:
string browserURL=  "/spm/kpi-setup/view/{spmkpiinstance}/preventative-analysis";
string tobeInjecetedURL =  "/spm/kpi-setup/view/40526/corrective-actions/";
My requirement:
Need to check if the browserURL is equivalent with tobeInjecetedURL  (highlighted in yellow).
i.e : Need to check if the url matches just before the curly braces. 
if it matches then I need to replace the  {spmkpiinstance} with value 40526.
Please suggest a generic solution for this . 

Answers (4)