[#ToIntegral] = ToIntegral :mrdocs: Convert string to integral type T. Leading whitespace, a leading +, or any trailing character fail the parsing. The required format expressed as regex is `‐?[0‐9]+` by default (or `‐?[0‐9a‐fA‐F]+` if base = 16). The minus sign is only permitted for signed integer types. == Synopsis Declared in `<util/strencodings.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> std::optional<T> ToIntegral( std::string_view str, size_t base = 10); ---- == Return Value std::nullopt if the entire string could not be parsed, or if the parsed value is not in the range representable by the type T. == Parameters [cols="1,4"] |=== | Name| Description | *str* | The string to parse. | *base* | The numeric base to parse in (default 10). |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#