Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make replace with count=0 a no-op #22325

Merged
merged 13 commits into from
Jul 4, 2017
Merged
Prev Previous commit
Next Next commit
add missing backtick (nalimilan)
  • Loading branch information
rfourquet committed Jul 4, 2017
commit 4f60ef71453a2dc747f4341f01aeb14c640354d2
2 changes: 1 addition & 1 deletion base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,7 @@ end
function replace(s::AbstractString, pat, f, n::Integer)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to add a comment explaining that replace_new needs to be renamed to replace when removing this deprecation (and make sure tests will fail if that's not the case).

if n <= 0
depwarn(string("`replace(s, pat, r, count)` with `count <= 0` is deprecated, use ",
"`replace(s, pat, r, typemax(Int))` or replace(s, pat, r)` instead"),
"`replace(s, pat, r, typemax(Int))` or `replace(s, pat, r)` instead"),
:replace)
replace(s, pat, f)
else
Expand Down