I have a list of items which I want to output in a razor view. Between each item I want to add a separator line, like this:

item1 | item2 | item3

The simplest way to loop through items is with a foreach:

@foreach(var item in Model.items){
  <span>@item.Name</span> | 
}

Unfortunately this adds an extra separator line at the end of the list. Is there a simple way to skip this last separator line?

Edit
Report