Forum Academy Marketplace Showcase Pricing Features

Truncate the middle of a text

Hey!

How do I truncate a text leaving the first 5 characters and the last 5 characters of the string?

Thank you!!!

Hi there, @jackpmorgan95… if I understand your post correctly, one way you can achieve the desired result is by using the :truncated to and :truncated from end to operators.

Here is an example where I have a field called text on the User data type, and I have a text element on the page that is getting the first five characters and the last five characters of that field.

truncate

Hope this helps.

Best…
Mike

Thanks mate! That is exactly what I needed!

1 Like