Skip to content

Commit b43c216

Browse files
nalimilanstevengj
authored andcommitted
Add isuppercase, islowercase, uppercasefirst and lowercasefirst (#516)
1 parent 4489b2b commit b43c216

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,9 @@ Currently, the `@compat` macro supports the following syntaxes:
382382

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

385+
* `isupper`, `islower`, `ucfirst` and `lcfirst` are now `isuppercase`, `islowercase`,
386+
`uppercasefirst` and `lowercasefirst` ([#26442]).
387+
385388
## New macros
386389

387390
* `@__DIR__` has been added ([#18380])
@@ -596,3 +599,4 @@ includes this fix. Find the minimum version from there.
596599
[#26149]: https://github.com/JuliaLang/julia/issues/26149
597600
[#26156]: https://github.com/JuliaLang/julia/issues/26156
598601
[#26316]: https://github.com/JuliaLang/julia/issues/26316
602+
[#26442]: https://github.com/JuliaLang/julia/issues/26442

src/Compat.jl

+8
Original file line numberDiff line numberDiff line change
@@ -1679,6 +1679,14 @@ else
16791679
const indexin = Base.indexin
16801680
end
16811681

1682+
if VERSION < v"0.7.0-DEV.4585"
1683+
export isuppercase, islowercase, uppercasefirst, lowercasefirst
1684+
const isuppercase = isupper
1685+
const islowercase = islower
1686+
const uppercasefirst = ucfirst
1687+
const lowercasefirst = lcfirst
1688+
end
1689+
16821690
include("deprecated.jl")
16831691

16841692
end # module Compat

test/runtests.jl

+8
Original file line numberDiff line numberDiff line change
@@ -1491,4 +1491,12 @@ end
14911491
# 0.7.0-DEV.3972
14921492
@test Compat.indexin([1, 2], [1, 0, 1]) == [1, nothing]
14931493

1494+
# 0.7.0-DEV.4585
1495+
@test isuppercase('A')
1496+
@test !isuppercase('a')
1497+
@test islowercase('a')
1498+
@test !islowercase('A')
1499+
@test uppercasefirst("qwerty") == "Qwerty"
1500+
@test lowercasefirst("Qwerty") == "qwerty"
1501+
14941502
nothing

0 commit comments

Comments
 (0)