CsvCellDecoderOps

kantan.csv.ops.CsvCellDecoderOps
final class CsvCellDecoderOps(val s: String)

Provides syntax for decoding CSV cells as values.

Importing kantan.csv.ops._ will add the following methods to String:

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

Decodes a CSV cell as a value of type A.

Decodes a CSV cell as a value of type A.

Attributes

Example
scala> "1".decodeCsv[Option[Int]]
res0: kantan.csv.DecodeResult[Option[Int]] = Right(Some(1))

Decodes a CSV cell as a value of type A.

Decodes a CSV cell as a value of type A.

Attributes

Example
scala> "1".unsafeDecodeCsv[Option[Int]]
res0: Option[Int] = Some(1)

Note that this method is unsafe and will throw an exception if the cell's value is not a valid A. Prefer decodeCsv whenever possible.

Concrete fields

val s: String