given is an URL like http://localhost:1973/Services.aspx?idProject=10&idService=14
.
What is the most straightforward way to replace both url-parameter values(for example 10 to 12 and 14 to 7)?
Regex, String.Replace, Substring or LinQ - i'm a little stuck.
Thank you in advance,
Tim
I ended with following, that's working for me because this page has only these two parameter:
string newUrl = url.Replace(url.Substring(url.IndexOf("Services.aspx?") + "Services.aspx?".Length), string.Format("idProject={0}&idService={1}", Services.IdProject, Services.IdService));
But thank you for your suggestions :)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…