Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
剃刀语法的新手。我有一个逗号分隔的列表,@item.profilePosition如下所示:item1,item2,item3。
@item.profilePosition
我需要在这样的类中输出列表class="item1 item2 item3。我需要创建一个带有拆分的数组吗?
class="item1 item2 item3
@string.Join(" ", item.profilePosition.Split(','))
假设这@item.profilePosition是一个字符串,你可以用空格替换逗号吗?
class="@item.profilePosition.Replace(",", " ")"