how to truncate string in rendering varitant field

Sitecore 9.1

 Sitecore SXA has a field type call Template, we can use it turncate string when necessary.

#set ($text = $item.ListingTitle)

#if ($text.Length > 100)
$text.Substring(0, 100)...

To use Template field, make sure the field name doesn't has speace.

Reference -

Another way is create a view rendering and use Component Field. - Component Field will cause the page hang in Mobile or other device, except desktop. DON'T Use.