function countChar(str:String, ch:String, n:Number)
To count the number of occurrences of ch in str
For example:
countChar(aabba,a,0) = 3
countChar(asdf,z,0) = 0
Hint: need to use string.substring() method

Well is looks like the teacher already gave you a big hint by telling you a function to make use of. Have you studied how that function works? Try to put something together and post it and we can try to give hints based on your attempt.

MacRumors attracts a broad audience
of both consumers and professionals interested in
the latest technologies and products. We also boast an active community focused on
purchasing decisions and technical aspects of the iPhone, iPod, iPad, and Mac platforms.