I got this XML file:
<Msg UserText="start 0">
</Msg>
<Msg UserText="A">
</Msg>
<Msg UserText="A">
</Msg>
<Msg UserText="start 1">
</Msg>
<Msg UserText="A">
</Msg>
<Msg UserText="start 2">
</Msg>
<Msg UserText="A">
</Msg>
<Msg UserText="A">
</Msg>
<Msg UserText="A">
</Msg>
I need to count How many 'A's are between each "start x"
i.e. for the above i would output:
start 0 : 2
start 1 : 1
start 2 : 3
How should i go about this in C# ? i had a few directions but I'm sure there are easier ones out there (e.g. using linq)
Msgdescendants of whatever your parent element is?