kyu_5.string_incrementer package¶
Submodules¶
kyu_5.string_incrementer.string_incrementer module¶
-
kyu_5.string_incrementer.string_incrementer.
get_first_digit_index
(string: str)[source]¶ Find index of first non digit char from right to left
- Parameters
string – input string
- Returns
index of first non digit char or None
-
kyu_5.string_incrementer.string_incrementer.
increment_string
(string: str) → str[source]¶ A function which increments a string, to create a new string: 1. If the string already ends with a number, the number should be incremented by 1. 2. If the string does not end with a number. the number 1 should be appended to the new string.
- Parameters
string – input string
- Returns
output string with incremented number