intParser

info.fingo.spata.text.StringParser.intParser
object intParser extends StringParser[Int]

Parser for integer values.

Attributes

Graph
Supertypes
trait StringParser[Int]
class Object
trait Matchable
class Any
Self type
intParser.type

Members list

Value members

Concrete methods

def apply(str: String): Int

Parses string to desired type.

Parses string to desired type.

If parsing fails this function should report error by throwing exception. This is further handled by parse to allow for exception-free, functional code.

Value parameters

str

the input string

Attributes

Returns

parsed value

Throws
RuntimeException

if text cannot be parsed to requested type

Note

This function assumes "standard" string formatting, e.g. point as decimal separator or ISO date and time formats, without any locale support. Use FormattedStringParser if more control over source format is required.