Golang in sixty seconds — Count occurrences in a string
Published in
1 min readDec 3, 2021
Did you ever want to quickly count how many times the letter s appears in Mississippi? Well Go has your back:
strings.Count("Mississippi", "s") // 4
One of the most common code golf challenges I’ve seen is to count the occurrences of a letter in a string and do something with the information. Let’s change every letter the word “Mississippi”…