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 serialCommaAnd syntax for Seq[String] #414

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

[extras-string] Add serialCommaAnd syntax for Seq[String] #414

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

Comments

@kevin-lee
Copy link
Owner

Task

Summary

[extras-string] Add serialCommaAnd 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 and (Oxford comma / Harvard comma).

Project Details

Version: 0.40.0

Description

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

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

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

List("aaa", "bbb").serialCommaAnd
// String = "aaa and bbb"

List("aaa", "bbb", "ccc").serialCommaAnd
// String = "aaa, bbb, and ccc"

List("aaa", "bbb", "ccc", "ddd").serialCommaAnd
// String = "aaa, bbb, ccc, and ddd"
@kevin-lee kevin-lee added the task Task label Aug 24, 2023
@kevin-lee kevin-lee self-assigned this Aug 24, 2023
kevin-lee added a commit that referenced this issue Aug 24, 2023
Close #414 - [`extras-string`] Add `serialCommaAnd` syntax for `Seq[String]`
@kevin-lee kevin-lee added this to the milestone42 milestone Aug 27, 2023
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