String filters

String filters are used to manipulate outputs and variables of the string type.

append

Appends characters to a string.

camelcase

Converts a string into CamelCase.

capitalize

Capitalizes the first word in a string

downcase

Converts a string into lowercase.

escape

Escapes a string.

handle/handleize

Formats a string into a handle.

md5

Converts a string into an MD5 hash.

An example use case for this filter is showing the Gravatar image associated with the poster of a blog comment:

sha1

Converts a string into a SHA-1 hash.

sha256

Converts a string into a SHA-256 hash.

hmac_sha1

Converts a string into a SHA-1 hash using a hash message authentication code (HMAC). Pass the secret key for the message as a parameter to the filter.

hmac_sha256

Converts a string into a SHA-256 hash using a hash message authentication code (HMAC). Pass the secret key for the message as a parameter to the filter.

newline_to_br

Inserts a <br > linebreak HTML tag in front of each line break in a string.

pluralize

Outputs the singular or plural version of an English string based on the value of a number. The first parameter is the singular string and the second parameter is the plural string.

prepend

Prepends characters to a string.

remove

Removes all occurrences of