Home

isupper

Isupper is a name given to a function or method used in several programming languages to test whether the alphabetic characters in a string are all uppercase. The check typically ignores digits, punctuation, and other non-cased characters, and it requires at least one cased character to be present for a positive result.

Python provides a string method named isupper, invoked as s.isupper(). It is Unicode-aware: it returns True if

In C, isupper is a function declared in ctype.h. It tests whether a given character is an

Other languages provide similar functionality under different names. Java offers Character.isUpperCase for single characters, while many

Common uses include input validation, formatting checks, and user interface constraints. Limitations include differing definitions of

every
cased
character
in
the
string
is
uppercase
and
there
is
at
least
one
cased
character;
non-cased
characters
are
ignored.
It
returns
False
for
the
empty
string
or
for
strings
with
any
lowercase
cased
character.
Examples:
'FOO'.isupper()
is
True;
'Foo'.isupper()
is
False;
'123'.isupper()
is
False;
'1A'.isupper()
is
True.
uppercase
letter
according
to
the
current
locale.
The
argument
must
be
representable
as
unsigned
char
or
EOF.
The
result
is
nonzero
if
uppercase,
and
zero
otherwise.
Behavior
is
locale-dependent
and
not
defined
for
multibyte
characters
beyond
the
current
locale.
languages
validate
strings
by
comparing
them
to
their
uppercase
form,
such
as
s.equals(s.toUpperCase()).
In
Unicode,
casing
rules
may
vary
by
language
and
implementation.
a
cased
character,
locale
dependencies
in
some
environments,
and
edge
cases
such
as
strings
containing
no
cased
characters.