Iterate over a string

https://codeeval.dev/gist/0baa979105d146a2b76bd3afbf773c98

Notice that range assumes that string is UTF-8 encoded and iterates over Unicode characters (runes), not bytes of the string.

First returned value i is byte index of the rune in the string, not Unicode character index.

To iterate over characters, use byte indexes:

https://codeeval.dev/gist/87f6e34c2409e56a7b87f0f553533641

Iterate over a slice

https://codeeval.dev/gist/dc433bd1d2a427720e5342ead27b2e77

Iterate over a map

https://codeeval.dev/gist/757780ebb45be1dc5dec6ed769c4e933

range over a string

range over a slice

range over a map

range over a channel