I have a loop:
<% foreach (User usedBy in discountDto.UsedBy)
{ %>
<%=usedBy.FullName%><br />
<% } %>
that often produces multiple lines with the same name:
Bob Smith
Mark Thomas
Mark Thomas
Steve Jones
I would like to aggregate the multiple lines to a single line followed by an integer representing the number of times that name occurred:
Bob Smith
Mark Thomas (2)
Steve Jones