All elements before last comma in a string in c#

Viewed 8882

How can i get all elements before comma(,) in a string in c#? For e.g. if my string is say

string s = "a,b,c,d";

then I want all the element before d i.e. before the last comma.So my new string shout look like

string new_string = "a,b,c";

I have tried split but with that i can only one particular element at a time.

4 Answers
Related