Class Lower
- Namespace
- YndigoBlue.Velocity.Functions
- Assembly
- YndigoBlue.Velocity.dll
Represents the LOWER string function that converts all characters in a string to lowercase.
public class Lower : Function, ICheckItem, IDefaultItem, IFilterItem, IElement
- Inheritance
-
Lower
- Implements
Remarks
The LOWER function converts all uppercase characters in a string to their lowercase equivalents. Non-alphabetic characters remain unchanged. Useful for case-insensitive comparisons, data normalization, and formatting output. Behavior with Unicode characters may vary by database system.
Examples
Normalize email addresses to lowercase before storage:
var schema = manager.LoadSchema("crm");
var contacts = schema["contacts"];
var query = new Query()
.Select([ contacts["id"], new Expression("email_lower", new Lower(contacts["email"])) ])
.From(contacts);
var results = manager.Retrieve(query);
Use the typed Column constructor when working with a pre-resolved column variable:
var schema = manager.LoadSchema("crm");
var contacts = schema["contacts"];
Column emailColumn = contacts["email"];
var query = new Query()
.Select([ contacts["id"], new Expression("email_lower", new Lower(emailColumn)) ])
.From(contacts);
var results = manager.Retrieve(query);
Convert a hard-coded string literal to lowercase:
var query = new Query()
.Select([ new Expression("lower_val", new Lower("HELLO WORLD")) ]);
var results = manager.Retrieve(query);
Constructors
- Lower(IEnumerable<IElement>)
Initializes a new instance of LOWER with multiple elements (typically for concatenation).
- Lower(string)
Initializes a new instance of LOWER for a string literal value.
- Lower(IElement)
Initializes a new instance of LOWER with a single element.
- Lower(Column)
Initializes a new instance of LOWER for a column.