Removes all instances of the argument string from the value.
Variable
sentence = 'Let’s eat, grandpa!'
Template
{{ sentence|cut:',' }
Result
Let’s eat grandpa!
|cut Filterremoves all instances of string_to_cut from the value.
s
(required)
– string to cut from the value.
Removes all instances of the argument string from the value.
sentence = 'Let’s eat, grandpa!'
{{ sentence|cut:',' }
Let’s eat grandpa!
Did we get something wrong? Is there a use case for the
cut filter that we should add? Please let us know.
Commentary
It is hard to think of a good use case for this.