A number of type Target
A ConvException If an overflow occurred during conversion or if no character of the input was meaningfully converted.
string s = "123"; auto a = parse!int(s); assert(a == 123); // parse only accepts lvalues static assert(!__traits(compiles, parse!int("123")));
import std.string : tr; string test = "123 \t 76.14"; auto a = parse!uint(test); assert(a == 123); assert(test == " \t 76.14"); // parse bumps string test = tr(test, " \t\n\r", "", "d"); // skip ws assert(test == "76.14"); auto b = parse!double(test); assert(b == 76.14); assert(test == "");
Parses a character input range to an integral value.