Function increase_rnumber

Source
pub fn increase_rnumber(s: &mut String)
Expand description

Increases ascii number at the end of the string.

ยงExamples

use my_ecs::prelude::*;

let mut s = "hello01".to_owned();
str_util::increase_rnumber(&mut s);
assert_eq!("hello02", s.as_str());

let mut s = "hello99".to_owned();
str_util::increase_rnumber(&mut s);
assert_eq!("hello100", s.as_str());

let mut s = "hello".to_owned();
str_util::increase_rnumber(&mut s);
assert_eq!("hello", s.as_str()); // String doesn't end with number.