6.3.10 Finding a character in a string: inString
The inString command tests to see if a string contains a
character.
-
inString takes two arguments:
-
str, a string.
- c, a character.
- inString(str,c) returns
the index of its first occurrence of the character c in the string
str, or -1 if c does not occur in str.
Examples.
-
Input:
inString("abcded","d")
Output:
- Input:
inString("abcd","e")
Output: