title: How can I parse HTTP urls in C#?
body: <p>My requirement is to parse Http Urls and call functions accordingly. In my current implementation, I am using nested if-else statement which i think is not an optimized way. Can you suggest some other efficient approch?</p>
  
  <p>Urls are like these: <br/></p>
  
  <ul>
  <li><code>server/func1</code></li>
  <li><code>server/func1/SubFunc1</code></li>
  <li><code>server/func1/SubFunc2</code></li>
  <li><code>server/func2/SubFunc1</code></li>
  <li><code>server/func2/SubFunc2</code></li>
  </ul>