-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 String#index/rindex!
methods
#12730
Add String#index/rindex!
methods
#12730
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an observation. Thanks Sija! <3
IndexError doesn't make sense here. Index error means the index was out of bounds. That's not the case here. |
@asterite Any ideas for a better ones? |
|
@asterite I have a bit of an issue with this, since |
Then |
Just like Just my opinion though! I'm sure others will propose more complex solutions. |
@asterite |
Let's just use |
Why Another idea: just use whatever |
7d1648b
to
6ddb1eb
Compare
5b973f8
to
6362c57
Compare
@beta-ziliani Good catch, fixed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Sija 🙏
|
IMO |
I fully agree with adding
rather than:
|
Oh, okay. "#rindex! is uncalled for;" reads like you wouldn't approve of it whatsoever. IMO the organizational aspects don't matter much. |
Adds
String#index!
andString#index!
methods, similar to the ones found inEnumerable
.Supersedes/closes #12729