CMPT 120, Course Exercise 3

Using the contents of Lecture 9, write a function first_pos_of_char(astring, achar) that returns the first position of the character contained in achar, in the string astring.

If the character is not present in the string, the function should return -1.

Remember that positions are indexed in 0.

Examples:

Submissions should be made on Coursys.