If i have a string
"https://test.local.com/{version}/123456
I want to replace {version}/123456 with v50.0
How can i do that ?
CodePudding user response:
Following is the possible solution.
string url = "https://test.local.com/{version}/123456";
int versionIndex = url.IndexOf("{version}");
string output = url;
if(versionIndex >= 0)
{
output = url.Substring(0,versionIndex) "v50.0";
}