fn string_to_int_array_of_digits(snumber: &str) -> Vec<i32> {
let mut digits = Vec::with_capacity(snumber.len());
for c in snumber.chars() {
if let Some(digit) = c.to_digit(10) {
digits.push(digit as i32);
}
}
digits
}
fn main() {
let snumber = "23089";
let digits = string_to_int_array_of_digits(snumber);
for digit in digits {
print!("{} ", digit);
}
}
/*
run:
2 3 0 8 9
*/