Computer Science Canada How can I have non-case sensitive input? |
Author: | asdfasdf123 [ Wed Jan 21, 2015 12:04 pm ] | ||
Post subject: | How can I have non-case sensitive input? | ||
What is it you are trying to achieve? I'm trying to make a survey program to prepare for my compsci final exam. What is the problem you are having? The program requires non-case sensitive input, which I have no clue how to program. Describe what you have tried to solve this problem I've tried editing the if statements to have more options (see code below) and looking up answers Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Please specify what version of Turing you are using 4.1 1.0.1 |
Author: | Insectoid [ Wed Jan 21, 2015 12:51 pm ] |
Post subject: | RE:How can I have non-case sensitive input? |
The easiest method is to convert all input to either lower or upper case before checking it. Loop over every character, and if it's the wrong case, change it to upper or lower. Then do your comparisons as normal. |
Author: | bubb4h0t3p [ Thu Jan 22, 2015 7:33 pm ] | ||||
Post subject: | Re: RE:How can I have non-case sensitive input? | ||||
Insectoid @ Wed Jan 21, 2015 12:51 pm wrote: The easiest method is to convert all input to either lower or upper case before checking it. Loop over every character, and if it's the wrong case, change it to upper or lower. Then do your comparisons as normal.
also the commands for doing this are
for converting it all to upper case or
for converting it all to lower case. |