fromString

Performs nothrow and @nogc string to native type conversion.

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

Return Value

Type: bool

true if success and false otherwise.

Examples

int value;
assert("123".fromString(value) && value == 123);

Meta