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

Add findlast and findprev examples to strings.md manual #29019

Merged
merged 2 commits into from
Oct 10, 2018

Conversation

royalbhati
Copy link
Contributor

Added documentation for findlast() function

@fredrikekre
Copy link
Member

Thanks for the PR and welcome as a contributor to Julia!
May I suggest that we combine your paragraph with the previous one? For example something like

You can search for the index of a particular character using the
[`findfirst`](@ref) and [`findlast`](@ref) functions:

```jldoctest
julia> findfirst(isequal('o'), "xylophone")
4

julia> findlast(isequal('o'), "xylophone")
7

julia> findfirst(isequal('z'), "xylophone")

```

and something similar can be done to also include findprev in the next paragraph if you feel like adding that. Thoughts?

@fredrikekre fredrikekre added the domain:docs This change adds or pertains to documentation label Sep 14, 2018
@royalbhati
Copy link
Contributor Author

Thanks for the PR and welcome as a contributor to Julia!
May I suggest that we combine your paragraph with the previous one? For example something like

You can search for the index of a particular character using the
[`findfirst`](@ref) and [`findlast`](@ref) functions:

```jldoctest
julia> findfirst(isequal('o'), "xylophone")
4

julia> findlast(isequal('o'), "xylophone")
7

julia> findfirst(isequal('z'), "xylophone")

and something similar can be done to also include `findprev` in the next paragraph if you feel like adding that. Thoughts?

Yes that sounds good

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
[`findnext`](@ref) and [`findprev`](@ref) with a three arguments:
Copy link
Member

Choose a reason for hiding this comment

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

"a three"

Maybe just remove the mention of the number of arguments, that's clear just by looking at the examples.

@fredrikekre fredrikekre changed the title Update strings.md Add findlast and findprev examples to string.md manual Oct 10, 2018
@fredrikekre fredrikekre changed the title Add findlast and findprev examples to string.md manual Add findlast and findprev examples to strings.md manual Oct 10, 2018
@fredrikekre fredrikekre merged commit e20d1ee into JuliaLang:master Oct 10, 2018
KristofferC pushed a commit that referenced this pull request Oct 19, 2018
KristofferC pushed a commit that referenced this pull request Feb 11, 2019
KristofferC pushed a commit that referenced this pull request Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants