islower
islower(c::Union{Char,AbstractString}) -> Bool
Tests whether a character is a lowercase letter, or whether this is true for all elements of a string. A character is classified as lowercase if it belongs to Unicode category Ll, Letter: Lowercase.
Examples
-
Check if a character is lowercase:
julia> islower('a') trueThis example checks if the character 'a' is lowercase. The function returns
truesince 'a' is indeed a lowercase letter. -
Check if a string contains only lowercase letters:
julia> islower("hello") trueIt checks if all characters in the string "hello" are lowercase. Since all the characters in the string are lowercase, the function returns
true. -
Handle mixed case strings:
julia> islower("HeLLo") falseIn this example, the function checks if the string "HeLLo" contains only lowercase letters. Since the string contains uppercase letters, the function returns
false. -
Handle empty strings:
julia> islower("") trueWhen an empty string is provided, the function returns
truesince there are no uppercase letters present.
Common mistake example:
julia> islower('A')
true
In this example, the function is used to check if the character 'A' is lowercase. However, since 'A' is an uppercase letter, the function should return false instead of true. It's important to understand that islower specifically checks for lowercase letters.
See Also
digits, inf, isdigit, iseven, isfinite, isless, islower, isnumber, isodd, isprime, isqrt, issorted, issubnormal, isxdigit, nan,User Contributed Notes
Add a Note
The format of note supported is markdown, use triple backtick to start and end a code block.