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

Username:   Password: 
 RegisterRegister   
 What is the index command?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Dragoooon




PostPosted: Sun Mar 23, 2003 5:56 pm   Post subject: What is the index command?

What does the index command do?
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sun Mar 23, 2003 6:45 pm   Post subject: (No subject)

it is used to see if a string in contrained withing another string and if so, returns the position where it starts.

code:

put index("compsci", "sci")

outputs 5 since "sci" starts on 5th character of "compsci"

it also works the other way:
code:

if index("1234567890", "1") not=0 then
put "its a digit"
else
put "its not a digit"
end if
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Dragoooon




PostPosted: Sun Mar 23, 2003 6:55 pm   Post subject: thx

thank you :)
al.ba




PostPosted: Wed Nov 22, 2017 8:54 pm   Post subject: RE:What is the index command?

Hi, I'm finding difficulties with a turing programming exercises on string manipulation it asks me to gather a word from the user and display it with every vowel exchanged with 9
kohul




PostPosted: Wed Apr 04, 2018 8:55 pm   Post subject: Re: RE:What is the index command?

al.ba @ Wed Nov 22, 2017 8:54 pm wrote:
Hi, I'm finding difficulties with a turing programming exercises on string manipulation it asks me to gather a word from the user and display it with every vowel exchanged with 9


Mod edit: deleted answer. OP came here to learn, not to cheat.

that should be it.
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  [ 5 Posts ]
Jump to:   


Style:  
Search: