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

Username:   Password: 
 RegisterRegister   
 selecting single or multiple letters in a string type variable
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
timtimpei




PostPosted: Thu May 01, 2008 7:52 pm   Post subject: selecting single or multiple letters in a string type variable

i was wondering how would you select a single or multiple letters/characters from a string type variable.

for example:

var name : string := "PETER"

and i only want to display the second letter of this name, in this case, the E.

is it possible? if not, wat is another solution?
Sponsor
Sponsor
Sponsor
sponsor
The_Bean




PostPosted: Thu May 01, 2008 8:05 pm   Post subject: Re: selecting single or multiple letters in a string type variable

strings can be used like arrays in which every letter has a spot in the string. So to only call the second letter in the string use " name(2)"
you can also look into the "index" function in the turing help files for other string manipulation technics.
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  [ 2 Posts ]
Jump to:   


Style:  
Search: