final class StringSeqOps extends AnyVal
- Annotations
- @SuppressWarnings()
- Alphabetic
- By Inheritance
- StringSeqOps
- AnyVal
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new StringSeqOps(ss: Seq[String])
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
commaAnd: String
Format Seq[String] into a human-readable list using comma and the conjunction
and
.Format Seq[String] into a human-readable list using comma and the conjunction
and
. It separates elements by commas and uses the termand
before the last element.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"
Example: -
def
commaOr: String
Format Seq[String] into a human-readable list using comma and the conjunction
or
.Format Seq[String] into a human-readable list using comma and the conjunction
or
. It separates elements by commas and uses the termor
before the last element.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"
Example: -
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.
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.
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"
Example: -
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
serialCommaAnd: String
Format Seq[String] into a human-readable list using comma and the conjunction
and
.Format Seq[String] into a human-readable list using comma and the conjunction
and
. It separates elements by commas and uses the termand
before the last element following the "Oxford comma" style. e.g.) "aaa, bbb, and ccc".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"
Example: -
def
serialCommaOr: String
Format Seq[String] into a human-readable list using comma and the conjunction
or
.Format Seq[String] into a human-readable list using comma and the conjunction
or
. It separates elements by commas and uses the termor
before the last element following the "Oxford comma" style. e.g.) "aaa, bbb, or ccc".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"
Example: -
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.
- Annotations
- @SuppressWarnings()
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"
Example: -
def
toString(): String
- Definition Classes
- Any