toInteger

Parse an integer value from the provided string. The exact type of integer parsed is determined by the template parameter T (see below).

The string is inspected for a sign and an optional radix prefix. A radix may be provided as an argument instead, whereupon it must match the prefix (where present). When radix is set to zero, conversion will default to decimal.

bool
toInteger
(
C
T
)
(
C[] digits
,
out T value
,
uint radix = 0
)

Parameters

C

char type of string

T

type of integer to parse (must be byte, ubyte, short, ushort, int, uint, long or ulong)

digits C[]

string to parse

value T

receives parsed integer

radix uint

specifies which radix to interpret the string as

Return Value

Type: bool

true if parsing succeeded

Meta