Pages

Monday 7 January 2013

Remove characters after specific character in string, then remove substring?

string input = "http://www.somesite.com/somepage.aspx?whatever";
int index = input.IndexOf("?");
if (index > 0)
   input = input.Substring(0, index);

No comments:

Post a Comment