🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
OCLOperators ToLower () : String
This page was created by Peter on 2019-11-22. Last edited by Wikiadmin on 2026-07-29.

You can use toLower() in OCL or EAL to return a string with its characters converted to lowercase, for example when preparing text for a case-independent comparison.

Syntax

<string-expression>.toLower()

The operator returns a new String value. It does not change the source attribute or variable.

Example

The following expression converts the text literal 'MDriven Designer' to lowercase:

'MDriven Designer'.toLower()

Result:

'mdriven designer'

Compare text without case differences

Convert both values before comparing them when uppercase and lowercase characters should be treated as equivalent:

self.Name.toLower() = 'anna'

For example, if self.Name is 'ANNA', the expression evaluates to true.

Related string operations

Use toLower() when you need lowercase output. Use toUpper() when you need uppercase output instead.

See also