Snootalogue/Views/Shared/DisplayTemplates/CommaSeparatedList.cshtml

15 lines
299 B
Text
Raw Normal View History

2020-09-16 01:43:55 +00:00
@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>
}
}