Create a method that takes an array of words (parameter) and counts the number of words that start with a specified character (parameter).?
Update:
Java Programming question.
1 Answer
Relevance
- Yanni DeppLv 61 month ago
function countWords($words, $char) { $c = 0; foreach($words as $word) { if(strpos(strtolower($word), strtolower($char)) === 0) { $c++; } } return $c; }
Still have questions? Get answers by asking now.