Copied to clipboard

Flag this post as spam?

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


  • Jukka-Pekka Keisala 79 posts 203 karma points
    Jul 19, 2022 @ 07:48
    Jukka-Pekka Keisala
    0

    StripHtml and Truncate in v10

    How do I strip and truncate html in v10? Is there a helper built in Umbraco for this?

  • Corné Hoskam 66 posts 546 karma points MVP c-trib
    Jul 19, 2022 @ 09:36
    Corné Hoskam
    100

    Hi Jukka-Pekka,

    The Umbraco.Extensions.StringExtensions class has a .StripHtml() extension method you can call on any string. This will return the string without any HTML tags in it!

    Hope this helped,

    Corné

Please Sign in or register to post replies

Write your reply to:

Draft