Django provides a variety of built-in template tags for working with strings in your templates. Here are some of the commonly used ones:
length: Returns the length of a string.
django{% with my_string="Hello, World!" %} {{ my_string|length }} {% endwith %}
default: If the variable is undefined or evaluates to False, a default value can be provided.
django{{ some_variable|default:"No value" }}
capfirst: Capitalizes the first character of a string.
django{{ "hello"|capfirst }}
lower: Converts a string to lowercase.
django{{ "Hello"|lower }}
upper: Converts a string to uppercase.
django{{ "hello"|upper }}
title: Converts the first character of each word to uppercase.
django{{ "hello world"|title }}
truncatewords: Truncates a string after a certain number of words.
django{{ "This is a long sentence."|truncatewords:3 }}
truncatechars: Truncates a string after a certain number of characters.
django{{ "This is a long sentence."|truncatechars:10 }}
slugify: Converts a string to a valid URL slug.
django{{ "This is a Title"|slugify }}
date: Formats a date according to the given format.
django{{ some_date|date:"F j, Y" }}
default_if_none: Provides a default value if the variable is None.
django{{ some_variable|default_if_none:"No value" }}
join: Joins the elements of a list into a string, using a specified delimiter.
django{{ my_list|join:", " }}
These are just a few examples, and Django provides more template tags for various string manipulation tasks. Make sure to check the official Django documentation for the most up-to-date and comprehensive information: Django Template Language - Built-in Tags and Filters.