The OpenD Programming Language

fromString

Performs nothrow and @nogc string to native type conversion.

Rseturns: true if success and false otherwise.

  1. template fromString(T)
  2. bool fromString(const(C)[] str, T value)
    bool
    fromString
    (
    T
    C
    )
    (
    scope const(C)[] str
    ,
    ref T value
    )

Examples

int value;
assert("123".fromString(value) && value == 123);
double value = 0;
assert("+Inf".fromString(value) && value == double.infinity);
assert("-nan".fromString(value) && value != value);

Meta