StringSeqOps

@SuppressWarnings(scala.Array.apply[java.lang.String]("org.wartremover.warts.IterableOps")(scala.reflect.ClassTag.apply[java.lang.String](classOf[java.lang.String])))
final class StringSeqOps(ss: Seq[String]) extends AnyVal
class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def commaAnd: String

Format Seq[String] into a human-readable list using comma and the conjunction and. It separates elements by commas and uses the term and before the last element.

Format Seq[String] into a human-readable list using comma and the conjunction and. It separates elements by commas and uses the term and before the last element.

Example:
 List.empty[String].commaAnd
 // String = ""
 List("").commaAnd
 // String = ""
 List("aaa").commaAnd
 // String = "aaa"
 List("aaa", "bbb").commaAnd
 // String = "aaa and bbb"
 List("aaa", "bbb", "ccc").commaAnd
 // String = "aaa, bbb and ccc"
 List("aaa", "bbb", "ccc", "ddd").commaAnd
 // String = "aaa, bbb, ccc and ddd"
def commaOr: String

Format Seq[String] into a human-readable list using comma and the conjunction or. It separates elements by commas and uses the term or before the last element.

Format Seq[String] into a human-readable list using comma and the conjunction or. It separates elements by commas and uses the term or before the last element.

Example:
 List.empty[String].commaOr
 // String = ""
 List("").commaOr
 // String = ""
 List("aaa").commaOr
 // String = "aaa"
 List("aaa", "bbb").commaOr
 // String = "aaa or bbb"
 List("aaa", "bbb", "ccc").commaOr
 // String = "aaa, bbb or ccc"
 List("aaa", "bbb", "ccc", "ddd").commaOr
 // String = "aaa, bbb, ccc or ddd"
def commaWith(conjunction: String): String

Extension method for a Seq[String], providing a way to join the elements with a comma and a given conjunction. It joins String values with commas and uses the given conjunction before the last element.

Extension method for a Seq[String], providing a way to join the elements with a comma and a given conjunction. It joins String values with commas and uses the given conjunction before the last element.

Example:
 List.empty[String].commaWith("BLAH")
 // String = ""
 List("").commaWith("BLAH")
 // String = ""
 List("aaa").commaWith("BLAH")
 // String = "aaa"
 List("aaa", "bbb").commaWith("BLAH")
 // String = "aaa BLAH bbb"
 List("aaa", "bbb", "ccc").commaWith("BLAH")
 // String = "aaa, bbb BLAH ccc"
 List("aaa", "bbb", "ccc", "ddd").commaWith("BLAH")
 // String = "aaa, bbb, ccc BLAH ddd"
def serialCommaAnd: String

Format Seq[String] into a human-readable list using comma and the conjunction and. It separates elements by commas and uses the term and before the last element following the "Oxford comma" style. e.g.) "aaa, bbb, and ccc".

Format Seq[String] into a human-readable list using comma and the conjunction and. It separates elements by commas and uses the term and before the last element following the "Oxford comma" style. e.g.) "aaa, bbb, and ccc".

Example:
 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"
def serialCommaOr: String

Format Seq[String] into a human-readable list using comma and the conjunction or. It separates elements by commas and uses the term or before the last element following the "Oxford comma" style. e.g.) "aaa, bbb, or ccc".

Format Seq[String] into a human-readable list using comma and the conjunction or. It separates elements by commas and uses the term or before the last element following the "Oxford comma" style. e.g.) "aaa, bbb, or ccc".

Example:
 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"
@SuppressWarnings(scala.Array.apply[java.lang.String]("org.wartremover.warts.IterableOps")(scala.reflect.ClassTag.apply[java.lang.String](classOf[java.lang.String])))
def serialCommaWith(conjunction: String): String

Extension method for a Seq[String], providing a way to join the elements with a serial comma and a given conjunction.

Extension method for a Seq[String], providing a way to join the elements with a serial comma and a given conjunction.

It joins String values with commas and uses the given conjunction before the last element.

This method employs the serial comma (also known as the Oxford comma), which means it always inserts a comma before the conjunction unless there are only two elements.

Example:
 List.empty[String].serialCommaWith("BLAH")
 // String = ""
 List("").serialCommaWith("BLAH")
 // String = ""
 List("aaa").serialCommaWith("BLAH")
 // String = "aaa"
 List("aaa", "bbb").serialCommaWith("BLAH")
 // String = "aaa BLAH bbb"
 List("aaa", "bbb", "ccc").serialCommaWith("BLAH")
 // String = "aaa, bbb, BLAH ccc"
 List("aaa", "bbb", "ccc", "ddd").serialCommaWith("BLAH")
 // String = "aaa, bbb, ccc, BLAH ddd"