Snootalogue/Views/Shared/DisplayTemplates/CommaSeparatedList.cshtml
2020-09-16 11:43:55 +10:00

14 lines
299 B
Text

@using System.Text;
@model List<string>
@{
if (@Model == null || @Model.Count == 0) {
<span class="list-empty"></span>
} else {
var sb = new StringBuilder();
foreach(var item in @Model) {
sb.AppendFormat("{0}, ", item);
}
<text>@sb.ToString().Substring(0, sb.Length - 2)</text>
}
}