String.parse_radix_int
String.parse_radix_int
Function
Parse the current integer text in the specified base.
Syntax
string.parse_radix_int(radix)
Parameters
| Parameters | Type | Required | Default value | Description |
|---|---|---|---|---|
| radix | Int | No | 10 | Base. |
Return value
| Type | Description |
|---|---|
| Int/Null | Returns Int if parsing is successful; Null if failed. |
Example
result = 'ff'.parse_radix_int(16) // Output: 255 print result
Notes
- Parse using Rust i64::from_str_radix.
- The original string will not be modified.