lundi 22 août 2016

How can we write the below program using a counter? i have succesfully made it run using a wordcount. Please help me on a looped/ counter approach [on hold]

Write a program to look for the occurrence of “red” in a given sentence. Capitalization does not matter in the given sentence.

            Examples:

  1. “pure delight”

Returns 0

  1. “read the RED sign followed by GREEN and red said fred”.

Returns: 3

  1. “Rendering red and redefining red”

Returns 3

Aucun commentaire:

Enregistrer un commentaire