jinja2 truncate string and get last part of string code example Example: python remove last character from string str = "string" str = str[:-1] # Returns "strin"