Copied to clipboard

Flag this post as spam?

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


  • Dana Halter 9 posts 89 karma points
    Mar 28, 2022 @ 13:16
    Dana Halter
    0

    Remove line breaks from content picker

    I need to remove line brakes from data inside a content picker.

    I'm getting the code from the content picker like so

    @{
        var disclaimer = Umbraco.Content(CurrentPage.standardDisclaimer);
       @Html.Raw(disclaimer.content)
    }
    

    Doing this returns the content from the Content Picker, however, the code is not clean and includes line breaks.

    I have tried fixes like var cleanedString = disclaimer.Replace("\r", "").Replace("\n", "").Trim(); with no luck.

    Any suggestions on removing line breaks from a content picker?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies