Forum Academy Marketplace Showcase Pricing Features

Truncate the middle of a text


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

Thank you!!!

Hi there,… 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.


Hope this helps.


Thanks mate! That is exactly what I needed!

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.