Menu
Coddy logo textTech

Character Occurrence Counter

Lesson 19 of 24 in Coddy's Golang Challenges - Level 1 course.

challenge icon

Challenge

Medium

We have a string like this: "avgofrcxgolangcoddy"

Write a function that checks how many times a given character is repeated in the string.

For example, if we check for the characters "go", the result will be: 2.

The function should take two string parameters: the characters we are looking for and the string in which we are going to search. It should return the count of occurrences.

Try it yourself

func countOccurrences()  {

}

All lessons in Golang Challenges - Level 1