HomeManualTopicsTypesSymbols

std_types::string/std::to_integer

converts the whole string into an integer value

Parameter

self
the string to convert

Results

None

Description

If the complete string can be converted into an integer then the resulting integer is returned.

If the conversion fails or does not consume the complete string then std::undefined is returned.

Example

$str "123" $value str.to_integer println! "value: " value

Output

value: 123

Example

$str "123, 456" $value str.to_integer dump! `value

Output

value: <undefined>

Topic

Strings

Implements

std::to_integer converts its argument into an integer number

See also

std_types::string/std::parse_integer