Skip to content
FutureBlitz

    Install

    Import std.core.parse

    std.core.parse

    Parsing numbers and Bools from text.

    Text to numbers and Bools: Parse, a Static Method on each, which gives Null for text that isn't one, or a number that doesn't fit. It reads what Format writes, invariantly: '.' for decimals, no thousands, and NaN, Inf, and -Inf for the floats that aren't numbers.

    std/core/parse.fb

    Extends

    Int8 extend

    Extend Int8

    Reading an Int8 from text.

    std/core/parse.fb, line 33

    • @PanicsAtCaller Public Static Method Parse(text: String, base: Int = 10): Int8? static method #

      The Int8 text writes in base, or Null.

    Int16 extend

    Extend Int16

    Reading an Int16 from text.

    std/core/parse.fb, line 44

    • @PanicsAtCaller Public Static Method Parse(text: String, base: Int = 10): Int16? static method #

      The Int16 text writes in base, or Null.

    Int32 extend

    Extend Int32

    Reading an Int32 from text.

    std/core/parse.fb, line 55

    • @PanicsAtCaller Public Static Method Parse(text: String, base: Int = 10): Int32? static method #

      The Int32 text writes in base, or Null: Int.Parse("42"), Int.Parse("ff", 16).

      Examples

      Expect(Int.Parse("42") == 42)
      Expect(Int.Parse("-7") == -7)
      Expect(Int.Parse("ff", 16) == 255)
      Expect(Int.Parse("4x") == Null)

    Int64 extend

    Extend Int64

    Reading an Int64 from text.

    std/core/parse.fb, line 75

    • @PanicsAtCaller Public Static Method Parse(text: String, base: Int = 10): Int64? static method #

      The Int64 text writes in base, or Null.

    UInt8 extend

    Extend UInt8

    Reading a UInt8 from text.

    std/core/parse.fb, line 83

    • @PanicsAtCaller Public Static Method Parse(text: String, base: Int = 10): UInt8? static method #

      The UInt8 text writes in base, or Null.

    UInt16 extend

    Extend UInt16

    Reading a UInt16 from text.

    std/core/parse.fb, line 94

    • @PanicsAtCaller Public Static Method Parse(text: String, base: Int = 10): UInt16? static method #

      The UInt16 text writes in base, or Null.

    UInt32 extend

    Extend UInt32

    Reading a UInt32 from text.

    std/core/parse.fb, line 105

    • @PanicsAtCaller Public Static Method Parse(text: String, base: Int = 10): UInt32? static method #

      The UInt32 text writes in base, or Null.

    UInt64 extend

    Extend UInt64

    Reading a UInt64 from text.

    std/core/parse.fb, line 116

    • @PanicsAtCaller Public Static Method Parse(text: String, base: Int = 10): UInt64? static method #

      The UInt64 text writes in base, or Null.

    Float32 extend

    Extend Float32

    Reading a Float32 from text.

    std/core/parse.fb, line 124

    • Public Static Method Parse(text: String): Float32? static method #

      The Float32 text writes, or Null for text that isn't a float or one too big for a Float32: Float.Parse("2.5").

    Float64 extend

    Extend Float64

    Reading a Float64 from text.

    std/core/parse.fb, line 135

    • Public Static Method Parse(text: String): Float64? static method #

      The Float64 text writes, or Null, which reads back every Float64 that Format writes.

      Examples

      Expect(Double.Parse("2.5") == 2.5)
      Expect(Double.Parse("1e3") == 1000.0)
      Expect(Double.Parse("two") == Null)

    Bool extend

    Extend Bool

    Reading a Bool from text.

    std/core/parse.fb, line 153

    • Public Static Method Parse(text: String): Bool? static method #

      True for "True", False for "False", and Null for any other text.

      Examples

      Expect(Bool.Parse("True") == True)
      Expect(Bool.Parse("yes") == Null)

    Report an issue with this page or with FutureBlitz on GitHub.