Skip to content

[DOC] Refine String#split documentation #12126

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kyanagi
Copy link
Contributor

@kyanagi kyanagi commented Nov 20, 2024

The current documentation for String#split is missing some details about its behavior.

  • Removing leading whitespace by split(' ')
  • Splitting into individual characters by split('')

Additionally, the first argument field_sep and the second argument limit operate independently. Explaining them separately would enhance readability.

Copy link
Contributor

@jeremyevans jeremyevans left a comment

Choose a reason for hiding this comment

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

This looks good, thank you for working on this. I think it would good for @BurdetteLamar to review as well.

I found one spelling issue, which should be fixed before merging. The other comment is just a suggestion, you can merge without it if you don't think it would be helpful.

@kyanagi kyanagi force-pushed the fix-doc-string-split branch 2 times, most recently from 0b91f40 to f576616 Compare November 20, 2024 07:10
The current documentation for `String#split` is missing some
details about its behavior.

* Removing leading whitespace by `split(' ')`
* Splitting into indivisual characters by `split('')`

Additionally, the first argument `field_sep` and the second argument
`limit` operate independently. Explaining them separately would enhance
readability.
@kyanagi kyanagi force-pushed the fix-doc-string-split branch from f576616 to 7f5f7c4 Compare November 20, 2024 07:23
@BurdetteLamar
Copy link
Member

Thanks, @everyone, for calling this to my attention. I'd like to address the comments here about examples, but in a new PR, after this is merged. (I like to think I'm good with the docs, but I'm definitely not good with the details of reviewing on GH.)

@hsbt hsbt added the Documentation Improvements to documentation. label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements to documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy