I have a string like this:
1,b,1,28,2,g,9,95,3,y,4,60,4,r,4,8,5,b,10,46,6,b,10,45,7,g,8,94,8,r,8,16,9,y,3,58,15,r,10,20,16,g,5,87,19,r,1,2,21,y,1,54,22,b,3,31,1,r,9,17
I want to split this every fourth time I hit a comma and afterwards count how many times it has been split, but I have no idea how to do so :-/
I came across this, but it is JavaScript and I want to be able to do this in C#:
var j:int = 0;
var h:String;
for(var thisvalue:String in thestring){
h += (j%4 == 3)?thisvalue+';':thisvalue+',';
j++;
}
See Question&Answers more detail:
os