Skip to content

Add a function for extracting digits, sign, and base prefix from a string but not calculating the final number #7

@jwodder

Description

@jwodder

The function should take a &str starting with a number and, on success, return a structure containing:

  • the Base of the number as determined from the prefix (if any)
  • an enum for the sign of the number
  • the digits of the number as a Vec<u32>
  • the remainder of the &str

This could be used to give strtoint-like functionality to libraries that provide custom integer types without having to make StrToInt generalizable to & implementable by all possible integer types.

Add variants of this function based on/corresponding to #3 and #4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request therefor

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions