title: All elements before last comma in a string in c#
body: <p>How can i get all elements before comma(,) in a string in c#?
  For e.g.
  if my string is say</p>
  
  <pre><code>string s = "a,b,c,d";
  </code></pre>
  
  <p>then I want all the element before d i.e. before the last comma.So my new string shout look like </p>
  
  <pre><code>string new_string = "a,b,c";
  </code></pre>
  
  <p>I have tried split but with that i can only one particular element at a time.</p>