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

[extras-string] Add serialCommaOr syntax for Seq[String] #417

Closed
kevin-lee opened this issue Aug 24, 2023 · 0 comments · Fixed by #424
Closed

[extras-string] Add serialCommaOr syntax for Seq[String] #417

kevin-lee opened this issue Aug 24, 2023 · 0 comments · Fixed by #424
Assignees
Labels
task Task
Milestone

Comments

@kevin-lee
Copy link
Owner

Task

Summary

[extras-string] Add serialCommaOr syntax for Seq[String]

It is to join a Seq[String] with , (comma) and the last and the second last elements should be also connected with or (Oxford comma / Harvard comma).

Project Details

Version: 0.40.0

Description

List.empty[String].serialCommaOr
// String = ""

List("").serialCommaOr
// String = ""

List("aaa").serialCommaOr
// String = "aaa"

List("aaa", "bbb").serialCommaOr
// String = "aaa or bbb"

List("aaa", "bbb", "ccc").serialCommaOr
// String = "aaa, bbb, or ccc"

List("aaa", "bbb", "ccc", "ddd").serialCommaOr
// String = "aaa, bbb, ccc, or ddd"
@kevin-lee kevin-lee added the task Task label Aug 24, 2023
@kevin-lee kevin-lee added this to the milestone42 milestone Aug 24, 2023
@kevin-lee kevin-lee self-assigned this Aug 24, 2023
kevin-lee added a commit that referenced this issue Aug 26, 2023
Close #417 - [`extras-string`] Add `serialCommaOr` syntax for `Seq[String]`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant