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 docs for String#[] #11690

Merged
merged 9 commits into from
Feb 1, 2022
Merged

Conversation

jkthorne
Copy link
Contributor

@jkthorne jkthorne commented Jan 4, 2022

No description provided.

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*.
Copy link
Contributor

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.

Copy link
Contributor Author

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.

src/string.cr Outdated Show resolved Hide resolved
@straight-shoota straight-shoota changed the title add docs for String#[] Add docs for String#[] Jan 4, 2022
src/string.cr Outdated Show resolved Hide resolved
src/string.cr Outdated Show resolved Hide resolved
src/string.cr Outdated Show resolved Hide resolved
src/string.cr Outdated Show resolved Hide resolved
src/string.cr Outdated Show resolved Hide resolved
jkthorne and others added 5 commits January 4, 2022 11:49
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]>
src/string.cr Outdated Show resolved Hide resolved
Co-authored-by: Jason Frey <[email protected]>
src/string.cr Outdated Show resolved Hide resolved
Co-authored-by: Oleh Prypin <[email protected]>
Copy link
Member

@beta-ziliani beta-ziliani left a comment

Choose a reason for hiding this comment

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

Thanks!

@beta-ziliani beta-ziliani added this to the 1.4.0 milestone Jan 28, 2022
@straight-shoota straight-shoota merged commit 6d38def into crystal-lang:master Feb 1, 2022
@jkthorne jkthorne deleted the docs_string branch February 1, 2022 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants