Skip to content

Instantly share code, notes, and snippets.

@windwp
Created October 22, 2015 08:33
Show Gist options
  • Save windwp/2152997763e295de1428 to your computer and use it in GitHub Desktop.
Save windwp/2152997763e295de1428 to your computer and use it in GitHub Desktop.
substring linqpath
void Main()
{
var url="http://google.com";
var startPos=url.IndexOf("chuong-")+7;
startPos.Dump();
var endPos=url.IndexOf("-",url.IndexOf("chuong-")+7)-startPos;
endPos.Dump();
var result=url.Substring(startPos,endPos);
result.Dump();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment