-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
substring search #583
Comments
Errm, by this, I mean:
|
Yeaaaahhhh sooo...
Possibly! I'm not sure yet :)
Soooo the problem is the process we're going through with No Starch to print the book. I'm not sure if by "the section on Strings" you're referring to Chapter 4 (more on string slices) or Chapter 8 (on
I think that would probably be better, yeah :) |
I'm gonna give this a close :) ❤️ |
Both versions of the book cover strings in a fair amount of detail, but one piece missing is substring searching. In particular, there are a lot of methods on the primitive
str
type that do various kinds of substring searching, whether it be testing the existence of a substring, finding its position, or just iterating over matches. In addition to this, many of said methods are generic on thePattern
trait, which might be a bit overwhelming to beginners, and therefore benefit greatly from a more cohesive explanation in the book.The second version of the book has an excellent section on building a grep, but the focus is (rightly) more about building a project rather than exploring the particulars of substring search.
Popping up a level, I think there's some good motivation for making simple substring search in Rust a bit more discoverable. In particular, searching for
substring
in std's API docs doesn't turn up any specific methods for doing substring search. Even googlingrust substring search
doesn't turn up much that's useful to beginners in the first few results.There's at least one documented case of someone getting lost enough to wind up on the issue tracker of a crate that is way overkill for the problem of simple substring search.
I'd be interested in helping to improve this situation. But I don't quite know what the process is.
The text was updated successfully, but these errors were encountered: