You begin at the f4th Index of the string and you try to find a digit from there.
Since you chose to return a size_t value
which basicly is an "unsigned int"
your "-1" you return (because you don't find a digit after the 3rd index)
is interpreted as an unsinged int which is this big number
"-1" in binary is represeted as 32 x 1. (11111111111111111111111111111111...)
when you now interpred this as an "unsigned int" it's "4294967295" and not -1