I have a loop:
<% foreach (User usedBy in discountDto.UsedBy)
{ %>
<%=usedBy.FullName%><br />
<% } %>
which often creates multiple lines with the same name:
Bob Smith
Mark Thomas
Mark Thomas
Steve Jones
I would like to combine several lines into one line, followed by an integer representing the number of times this happened:
Bob Smith
Mark Thomas (2)
Steve Jones
source
share