Home

toUpperCase

toUpperCase is a string transformation operation that converts all alphabetic characters in a string to uppercase. It typically returns a new string and does not modify the original input. The transformation uses Unicode case mappings so that letters from various scripts are converted to their uppercase equivalents, while non-letter characters such as digits and punctuation remain unchanged.

In many programming languages, the function is exposed as a method named toUpperCase on string values. For

For locale-aware casing, many environments provide a separate variant, such as toLocaleUpperCase(locale). This allows uppercase mapping

Compatibility and usage notes: The concept appears across many languages, including Java, C#, Python, and JavaScript.

example,
in
JavaScript,
"hello".toUpperCase()
returns
"HELLO".
Some
languages
also
demonstrate
common
edge
cases,
such
as
"straße".toUpperCase()
yielding
"STRASSE"
due
to
the
German
sharp
s
being
mapped
to
"SS"
in
uppercase.
It
is
important
to
note
that
the
standard
toUpperCase
method
is
typically
not
locale-aware;
it
relies
on
a
default
Unicode
mapping
rather
than
language-specific
rules.
to
follow
rules
of
a
specified
locale
(for
example,
Turkish).
Locale-specific
behavior
can
differ
from
the
default
mapping,
particularly
for
languages
with
special
casing
rules
like
Turkish
and
Azerbaijani,
where
certain
letters
transform
in
language-dependent
ways.
Implementations
vary
in
how
fully
they
handle
Unicode
and
locale-specific
rules.
When
exact
casing
behavior
matters
(for
example,
in
user-facing
text
or
case-insensitive
comparisons),
developers
may
choose
to
use
locale-aware
variants
or
additional
normalization
steps.