Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Jon 47 posts 290 karma points
    Sep 14, 2018 @ 12:28

    Umbraco.MultipleTextstring » Comma separated

    Hi Umbracos

    Im trying to get this MultipleTextstring to show as an Comma Separated list. Code working – just missing the commas?

            if (Model.Content.GetPropertyValue<string[]>("tags").Length > 0)
              foreach (var tag in Model.Content.GetPropertyValue<string[]>("tags"))
  • Kevin Jump 1349 posts 8447 karma points MVP 2x c-trib
    Sep 14, 2018 @ 13:09
    Kevin Jump


    once you have the tags in an array you can use string.Join to put the comma in

    var tags = Model.Content.GetPropertyValue<string[]>("tags")
    @string.Join(", ", tags);

    will add , (and space) between each item in the list

Please Sign in or register to post replies

Write your reply to: