Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# remove everything after last slash

string input = "http://www.somesite.com/somepage.aspx?whatever";
int index = input.LastIndexOf("/");
if (index >= 0)
    input = input.Substring(0, index); // or index + 1 to keep slash
 
PREVIOUS NEXT
Tagged: #remove #slash
ADD COMMENT
Topic
Name
5+9 =