Krz*_*zos 21 python django templates substr
有人能告诉我,在Django模板中是否存在类似PHP中的substr(http://pl2.php.net/manual/en/function.substr.php)的方法?
小智 6
你可以使用cut过滤器,例如:
{{ value }} -> 'hello world'
{{ value|cut:'hello ' }} -> 'world'
Run Code Online (Sandbox Code Playgroud)