cut Filter

String

Argument: s (required) – string to cut from the value.

Documentation

Alignment filters add whitespace on one or both sides of the value.

Variable

sentence = 'Let’s eat, grandpa!'

Template

{{ sentence|cut:',' }

Result

Let’s eat grandpa!

Commentary

It is hard to think of a good use case for this.


Did we get something wrong? Is there a use case for the cut filter that we should add? Please let us know.

Send Feedback

Official Documentation
This page last updated on Sept. 16, 2020, 7:34 p.m. EST