Minor optimization

There are no reason to slice out first number
when second string does not contains a number.