-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
deprecationThis change introduces or involves a deprecationThis change introduces or involves a deprecationsearch & findThe find* family of functionsThe find* family of functions
Description
In 0.7 search has been deprecated in favor of findfirst / findlast, however these behave differently than search in some cases, e.g. if a value is not found.
julia> search("x",'y') # returns 0 in 0.6, nothing in 0.7
0Another error occurs with 0.6 and Compat when using Compat.findfirst and passing Unicode strings.
julia> Compat.findfirst("uniçº∂e",'x') # works on 0.7, fails on 0.6
ERROR: UnicodeError: invalid character index 5 (0xa7 is a continuation byte)
Stacktrace:
[1] slow_utf8_next(::Ptr{UInt8}, ::UInt8, ::Int64, ::Int64) at ./strings/string.jl:172
[2] next at ./strings/string.jl:204 [inlined]
[3] getindex(::String, ::Int64) at ./strings/basic.jl:32
[4] findnext(::String, ::Char, ::Int64) at ./array.jl:1262
[5] findfirst(::String, ::Char) at ./array.jl:1288
[6] findfirst(::String, ::Vararg{Any,N} where N) at /home/tbole/.julia/v0.6/Compat/src/Compat.jl:1589Metadata
Metadata
Assignees
Labels
deprecationThis change introduces or involves a deprecationThis change introduces or involves a deprecationsearch & findThe find* family of functionsThe find* family of functions