Truncate or Remove Spaces in Python Django

Truncate or Remove Spaces in Python Django

#truncate:
 {{ variable|truncatechars:255 }}
 #replace spaces:
 string1 = string.replace('  ', '').replace('\r', '').replace('\n', '')

 string1 = string1[:400]

Leave a Reply

Your email address will not be published. Required fields are marked *