diff --git a/doc/src/manual/strings.md b/doc/src/manual/strings.md index 304b3c2e3300d..0b00898bbf73b 100644 --- a/doc/src/manual/strings.md +++ b/doc/src/manual/strings.md @@ -617,20 +617,21 @@ julia> "1 + 2 = 3" == "1 + 2 = $(1 + 2)" true ``` -You can search for the index of a particular character using the [`findfirst`](@ref) function: +You can search for the index of a particular character using the +[`findfirst`](@ref) and [`findlast`](@ref) functions: ```jldoctest -julia> findfirst(isequal('x'), "xylophone") -1 +julia> findfirst(isequal('o'), "xylophone") +4 -julia> findfirst(isequal('p'), "xylophone") -5 +julia> findlast(isequal('o'), "xylophone") +7 julia> findfirst(isequal('z'), "xylophone") ``` -You can start the search for a character at a given offset by using [`findnext`](@ref) -with a third argument: +You can start the search for a character at a given offset by using +the functions [`findnext`](@ref) and [`findprev`](@ref): ```jldoctest julia> findnext(isequal('o'), "xylophone", 1) @@ -639,6 +640,9 @@ julia> findnext(isequal('o'), "xylophone", 1) julia> findnext(isequal('o'), "xylophone", 5) 7 +julia> findprev(isequal('o'), "xylophone", 5) +4 + julia> findnext(isequal('o'), "xylophone", 8) ```