#19278 closed New feature (invalid)
Return the string after a certain number of words
Description ¶
I don't know how to explain the feature that I want. This example can help.
I have a text:
"My name is Stefano and I'm from Uruguay."
And I want to show:
"My name is Stefano...
...and I'm from Uruguay"
I'm using truncatewords for the first line.
Change History (2)
comment:1 by , 12 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 12 years ago
I've found the solution: {{ my_text.split|slice:'4:'|join:' ' }}
But it would be great to have a filter like 'truncatewords' for this.
Note:
See TracTickets
for help on using tickets.
https://code.djangoproject.com/wiki/TicketClosingReasons/UseSupportChannels