Add a trim function to templates.
trim 5 should return the first 5 characters trim -5 should return the last 5 characters
Bence Ferdinandy referenced this ticket in commit 9d8d74d.