asp.net - find string using c#? -


i trying find string in below string.

http://example.com/tigs/sim/lists/team discussion/dispform.aspx?id=1779 

by using http://example.com/tigs/sim/lists string. how can team discussion word it?

some times strings

   http://example.com/tigs/sim/lists/team discussion/dispform.aspx?id=1779      need `team discussion`  http://example.com/tigs/alif/lists/artifical lift discussion forum 2/dispform.aspx?id=8      need  `artifical lift discussion forum 2` 

if wanted see regular expression example:

        string input = "http://example.com/tigs/sim/lists/team discussion/dispform.aspx?id=1779";         string given = "http://example.com/tigs/sim/lists";         system.text.regularexpressions.regex regex = new system.text.regularexpressions.regex(given + @"\/(.+)\/");         system.text.regularexpressions.match match = regex.match(input);         console.writeline(match.groups[1]); // team discussion 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -