Isupper is not working

Just to make sure that the package is installed even though the Unicode package is in the standard library so I don’t need to add it, I write these simple lines and still does not work:

julia> using Pkg
julia> Pkg.add(“Unicode”)

julia> isupper(‘A’)
ERROR: UndefVarError: isupper not defined
Stacktrace:
[1] top-level scope
@ REPL[3]:1
julia> using Unicode
julia> isupper(‘A’)
ERROR: UndefVarError: isupper not defined
Stacktrace:
[1] top-level scope
@ REPL[5]:1

I just want to make a function that tells me if the word is in all uppercase, like this:

function es_mayusculas(str::String)
letras = filter(isletter, str)
son = isupper(letras)
return son
end

The function you want is isuppercase. To check if all characters in a string are uppercase use

all(isuppercase, str)
1 Like

Thanks. So the isupper function no longer works?

It looks like isupper was changed to isuppercase at around version 0.6, maybe 7 years ago? Not sure, I’ve never seen it before.

1 Like