Copied to clipboard

Flag this post as spam?

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


  • Linx 98 posts 259 karma points
    Nov 03, 2022 @ 14:56
    Linx
    0

    Where has ReplaceLineBreaks gone?

    Hi guys

    In previous versions I was using,

    Umbraco.library.ReplaceLineBreaks(somestring);
    

    I was looking into Umbraco 10, but can't work out how this is now used in a Controller?

    Looked at the documentation but most was related to cshtml pages and not a way to use it in a Controller.

    Does anyone have an example I could follow?

    Thank you

  • Matthew Care 12 posts 145 karma points c-trib
    Nov 03, 2022 @ 16:33
    Matthew Care
    0

    Hello,

    I'm not sure of what ReplaceLineBreaks did originally, but there is a string extension called ReplaceLineEndings which you can run on a string like "here is a string".ReplaceLineEndings("replacement value").

    Alternavitely there is also @Html.ReplaceLineBreaks("string") which might be what you're looking for.

  • 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