Previous Up Next

2.4.7  Find a character in a string : inString

inString takes two arguments : a string S and a character c.
inString tests if the character c is in the string S.
inString returns "the index of its first occurence" or -1 if c is not in S.
Input :

inString("abcded","d")

Output :

3

Input :

inString("abcd","e")

Output :

-1

Previous Up Next