I’m using Split to pick different parts of a long string. Then I also use Split to rebuild the same string back to a long string again, but without the first part of the string
string.Split(',')[1] + "," + string.Split(',')[2] + "," + string.Split(',')[3] ....
The string I’m using
string info = "id,title,director,actor1,actor2,actor3,genre,runtime,year,comment";
My question is if there is a simple and uncomplicated way to rebuild the string without using Split like I do? Since I want all parts of the string without the first part, the id, then there should be a simple way to just remove every thing before the first comma sign?
I suppose that you do not know the length of the substrings, but you want to cut away everything before the first comma (including the comma) so the simplest thing to do is probably looking for the position of this comma and then take everything after that: