Write a program to check if a string contains only digits.
Case 1 :
Input: str = “23466423”
Output: true
The given string contains only digits so that output is true.
Case 2 :
Input: str = “OnlineLearningCenter2020”
Output: false
The given string contains alphabet character and digits so that output is false.
Published By : Hardik Patel