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
  • 1 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 your answers by asking now.