downcase¶
The downcase filter is designed to convert all characters in a string to lowercase.
Functionality
- Strings: Takes a string as input.
- Conversion: Changes all uppercase letters to lowercase.
- Output: Returns a new string with all lowercase letters.
Syntax
Arguments
The downcase filter does not require any arguments.
Code Samples
Example 1: Lowercasing a Sentence
Output:
Example 2: Lowercasing Mixed CaseOutput:
Outliers and Special Cases¶
- Empty Strings: If the input string is empty, the
downcasefilter returns an empty string. - Already Lowercase: If the input string is already in lowercase, the filter does not change the string.
- Non-String Input: If the input is not a string, the
downcasefilter might attempt to convert it to a string or return an error, depending on how Experience Builder handles type conversions.
Key Points¶
- The
downcasefilter is a simple but effective tool for normalizing text and ensuring consistency in case. - It is useful for comparing strings in a case-insensitive manner or for formatting text for display in lowercase.
- Combine it with other string filters like
upcaseorcapitalizefor more complex text transformations.