Copied to clipboard

Flag this post as spam?

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


  • suzyb 474 posts 932 karma points
    Aug 24, 2011 @ 22:54
    suzyb
    0

    Extra space in razor macro

    I'm trying to output a comma seperated list of values like so accountancy, office, IT but I'm getting an extra space between the value and the comma (i.e. accountancy , office , IT) when I have nicely formatted code.

    This is my code, is there any way to keep it nicely formatted but not have an extra space being added.

    <a href="@landing.Url?tag=@t">@t</a>
    if (i < tags.Count()) { <text>, </text> }
  • Barry Fogarty 493 posts 1129 karma points
    Aug 25, 2011 @ 14:22
    Barry Fogarty
    0
    <ahref="@landing.Url?tag=@t">@t</a>
    if (i < tags.Count()) {
    <text>,</text> }
  • Barry Fogarty 493 posts 1129 karma points
    Aug 25, 2011 @ 14:25
    Barry Fogarty
    0
    <a href="@landing.Url?tag=@t">@t</a>
    if (i < tags.Count()) {
    <text>,</text> }


    The above comment screwed up the code formatting, but it looks like you simply need to remove the space after the comma in the second line.
  • suzyb 474 posts 932 karma points
    Aug 25, 2011 @ 15:29
    suzyb
    0

    I want the space after the comma, just not before it.  The only way to do that seems to be by scrunching the code up like this

    <ahref="@landing.Url?tag=@t">@t</a>if(i < tags.Count()){<text>, </text>}

     

  • Johan 188 posts 380 karma points
    Apr 03, 2012 @ 14:36
Please Sign in or register to post replies

Write your reply to:

Draft