-
-
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 docs for String#[]
#11690
Add docs for String#[]
#11690
Conversation
src/string.cr
Outdated
def []?(index : Int) : Char? | ||
char_at(index) { nil } | ||
end | ||
|
||
def []?(str : String | Char) | ||
# Returns the `String?` if the given *str* is in *self*. |
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.
Which String?
? Ditto for below.
Also the code fails to compile for Char
arguments due to the added return value restriction. It shouldn't be added.
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.
updated via dfcf6bc. I dont know but I think this solves the concern you have.
Co-authored-by: Johannes Müller <[email protected]>
Co-authored-by: Johannes Müller <[email protected]>
Co-authored-by: Johannes Müller <[email protected]>
Co-authored-by: Johannes Müller <[email protected]>
Co-authored-by: Johannes Müller <[email protected]>
Co-authored-by: Jason Frey <[email protected]>
Co-authored-by: Oleh Prypin <[email protected]>
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.
Thanks!
No description provided.