Skip to content

Rust book: explain in strings chapter how to get a substring reference #25853

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

Closed
nliberg opened this issue May 28, 2015 · 0 comments
Closed

Rust book: explain in strings chapter how to get a substring reference #25853

nliberg opened this issue May 28, 2015 · 0 comments

Comments

@nliberg
Copy link
Contributor

nliberg commented May 28, 2015

In strings.md it could be useful to explain the &s[1..2] and &s[2..] syntax for getting a substring slice.

Looking for a way to get a substring reference one is currently faced with the str API documentation which is quite a lot to digest and if one manages to find the unstable slice_chars(...) it says "Use slicing syntax if you want to use byte indices rather than codepoint indices", but what "slicing syntax" means will probably not be clear to someone who is new to Rust and not yet familiar with the Index trait.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants