• Advertisement
Sign in to follow this  

Dealing with input from both upper/lowercase letters

This topic is 4756 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

im trying to create a Y/N prompt (and have to quite a bit), and was wondering if there was a more eficient way then to have an if statement for both "y" and "Y". Is there an easier way?

Share this post


Link to post
Share on other sites
Advertisement
if(tolower(input) == 'y') {
// yes
} else if(tolower(input) == 'n') {
// no
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement