Skip to content

toUpperCase

Description

Converts all alphabetical characters in a string to uppercase.

Syntax

Like many functions in DataPrime, toUpperCase supports two notations, function and method notation. These interchangeable forms allow flexibility in how you structure expressions.

toUpperCase(value: string): string
(value: string).toUpperCase(): string

Arguments

NameTypeRequiredDescription
valuestringtrueThe string to transform to uppercase

Example

Normalize UUIDs for comparison

Consider the following document:

{
    "uuid1": "37367559-35f4-459c-943e-19025765da15",
    "uuid2": "37367559-35F4-459C-943E-19025765DA15"
}

A direct comparison would fail due to differing cases. Use toUpperCase to normalize them:

filter toUpperCase(uuid1) == toUpperCase(uuid2)
filter uuid1.toUpperCase() == uuid2.toUpperCase()

Output

{
    "uuid1": "37367559-35f4-459c-943e-19025765da15",
    "uuid2": "37367559-35F4-459C-943E-19025765DA15"
}