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 90 posts 226 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 80 posts 587 karma points MVP 2x c-trib
    Jul 19, 2022 @ 09:36
    Corné Hoskam
    101

    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