I am making a command line program that finds factors of a number that the user enters. At the moment the user could enter something like this: '768r7fg38gf8320rf' which returns an error. I would like to restrict the user so they can only enter numbers (0 - 9). How would I do this?
_Michael_
Salem 5,199 Posting Sage
_Michael_
mrnutty 761 Senior Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.