How can I get all the elements before the comma (,) in a string in C #? E.g. if my line says
string s = "a,b,c,d";
then I want the whole element to d ie before the last comma. So my new line scream looks like
string new_string = "a,b,c";
I tried to split, but with this I can only one specific element at a time.
source share