Computer Science Canada changing to lower case |
Author: | sweetiechic [ Wed Oct 18, 2006 10:38 pm ] |
Post subject: | changing to lower case |
I made a program that asks someone to enter a string/sentence, and I'm suppose to change the capital letters to lower case, how do i do that? ![]() |
Author: | TokenHerbz [ Thu Oct 19, 2006 12:08 am ] |
Post subject: | |
i dont think my version of Turing has such a function to accomplish this, though it would be possible to creat your own. If you'd like, i can assist, but provided you have knowledge in chr(), ord(). This is because if you are using code you dont understand, you'r going to get introuble in various situations, like telling your teacher how you came up with this, and to demonstrate your understanding of it. I don't know if "other" versions has a function to do it, but that would be much easier, or so i would assume. |
Author: | Clayton [ Thu Oct 19, 2006 9:20 am ] |
Post subject: | |
Or, if you arent up to making your own function, use Str.Lower (text : string), which transforms the string parameter to all lower case ![]() |
Author: | TokenHerbz [ Thu Oct 19, 2006 10:40 pm ] |
Post subject: | |
ooo sexy, there is one, i thought so, Can you post the fcn.tu/fcn.t to me in a PM, thx thx... also for the Str.Upper and all the other ones accociated with it. |
Author: | sweetiechic [ Mon Oct 23, 2006 7:48 pm ] |
Post subject: | |
hm I found another way to do it.. var sentence: string var newstring: string newstring:= "" put "Enter a sentence:" get sentence:* cls for x: 1..length(sentence) if ord (sentence(x..x)) >= 65 and ord (sentence(x..x))<=90 then newstring:=newstring + chr (ord(sentence(x..x))+32) else newstring:= newstring + sentence(x..x) end if end for put newstring |
Author: | Clayton [ Mon Oct 23, 2006 9:01 pm ] |
Post subject: | |
why would you put sentence (x..x)? its redundant. Its like saying "Please list all of the whole numbers from 1 - 1 inclusive ![]() ![]() |