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 Iter[String]::join #1301

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

add Iter[String]::join #1301

wants to merge 2 commits into from

Conversation

hackwaly
Copy link
Contributor

@hackwaly hackwaly commented Dec 5, 2024

Closes #1257

@hackwaly hackwaly requested a review from bobzhang December 5, 2024 14:49
@coveralls
Copy link
Collaborator

coveralls commented Dec 5, 2024

Pull Request Test Coverage Report for Build 4158

Details

  • 5 of 5 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 80.841%

Totals Coverage Status
Change from base Build 4155: 0.02%
Covered Lines: 4498
Relevant Lines: 5564

💛 - Coveralls

@hackwaly hackwaly force-pushed the yuxiang/iter-string-join branch from 12335c3 to 2dc847d Compare December 9, 2024 06:59
@@ -781,6 +781,14 @@ pub fn collect[T](self : Iter[T]) -> Array[T] {
result
}

///|
/// Collects the elements of the iterator into a string.
pub fn join(self : Iter[String], separator~ : String = "") -> String {
Copy link
Contributor Author

@hackwaly hackwaly Dec 9, 2024

Choose a reason for hiding this comment

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

Shall we change the label "separator" to "sep"?

@hackwaly hackwaly force-pushed the yuxiang/iter-string-join branch from 929bb82 to 74a68f7 Compare December 9, 2024 07:08
@hackwaly hackwaly marked this pull request as draft December 9, 2024 08:44
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

Successfully merging this pull request may close these issues.

add Iter[String]::join
3 participants