Skip to content

Commit

Permalink
Add isuppercase, islowercase, uppercasefirst and lowercasefirst (#516)
Browse files Browse the repository at this point in the history
  • Loading branch information
nalimilan authored and stevengj committed Mar 15, 2018
1 parent 4489b2b commit b43c216
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,9 @@ Currently, the `@compat` macro supports the following syntaxes:

* `LinSpace` is now `LinRange` ([#25896]).

* `isupper`, `islower`, `ucfirst` and `lcfirst` are now `isuppercase`, `islowercase`,
`uppercasefirst` and `lowercasefirst` ([#26442]).

## New macros

* `@__DIR__` has been added ([#18380])
Expand Down Expand Up @@ -596,3 +599,4 @@ includes this fix. Find the minimum version from there.
[#26149]: https://github.com/JuliaLang/julia/issues/26149
[#26156]: https://github.com/JuliaLang/julia/issues/26156
[#26316]: https://github.com/JuliaLang/julia/issues/26316
[#26442]: https://github.com/JuliaLang/julia/issues/26442
8 changes: 8 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1679,6 +1679,14 @@ else
const indexin = Base.indexin
end

if VERSION < v"0.7.0-DEV.4585"
export isuppercase, islowercase, uppercasefirst, lowercasefirst
const isuppercase = isupper
const islowercase = islower
const uppercasefirst = ucfirst
const lowercasefirst = lcfirst
end

include("deprecated.jl")

end # module Compat
8 changes: 8 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1491,4 +1491,12 @@ end
# 0.7.0-DEV.3972
@test Compat.indexin([1, 2], [1, 0, 1]) == [1, nothing]

# 0.7.0-DEV.4585
@test isuppercase('A')
@test !isuppercase('a')
@test islowercase('a')
@test !islowercase('A')
@test uppercasefirst("qwerty") == "Qwerty"
@test lowercasefirst("Qwerty") == "qwerty"

nothing

0 comments on commit b43c216

Please sign in to comment.