How can I limit a string length? I\'m getting a description value from my database, but I want to only display a number of specific characters.
I used this to truncate blog posts and show an ellipsis..
{{ post.excerpt|striptags|length > 100 ? post.excerpt|striptags|slice(0, 100) ~ '...' : post.excerpt|striptags }}
If the post excerpt length is greater than 100 characters then slice it at the 100s character starting from the first one and append an '...'
Otherwise show full text..