Added method to check if given string contains only digits.