Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 changing to lower case
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
sweetiechic




PostPosted: 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? Confused
Sponsor
Sponsor
Sponsor
sponsor
TokenHerbz




PostPosted: Thu Oct 19, 2006 12:08 am   Post subject: (No 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.
Clayton




PostPosted: Thu Oct 19, 2006 9:20 am   Post subject: (No 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 Very Happy
TokenHerbz




PostPosted: Thu Oct 19, 2006 10:40 pm   Post subject: (No 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.
sweetiechic




PostPosted: Mon Oct 23, 2006 7:48 pm   Post subject: (No 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
Clayton




PostPosted: Mon Oct 23, 2006 9:01 pm   Post subject: (No subject)

why would you put sentence (x..x)? its redundant. Its like saying "Please list all of the whole numbers from 1 - 1 inclusive Confused instead use "put sentence (x)" as it puts the character at sentence x Very Happy
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: