Created
June 21, 2022 21:38
-
-
Save elulcao/68bcaa9bac51b5561c79cc74d6a93e99 to your computer and use it in GitHub Desktop.
Get next rune with Go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// getNextRune returns the next rune in the alphabet | |
func getNextRune(ch rune) rune { | |
return (ch+1-'a')%('z'-'a'+1) + 'a' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment