diff --git a/misc.go b/misc.go index 7bbb8eb..ac14cc1 100644 --- a/misc.go +++ b/misc.go @@ -2,6 +2,7 @@ package main import ( "slices" + "unicode" ) var whitespaceChars = []rune{' ', '\t', '\n'} @@ -111,3 +112,12 @@ func genRange(start, end int) []int { } return toRet } + +// Returns a rune-slice containing all possible cases of the given rune. +// At the moment, this includes: +// 1. Upper case +// 2. Lower case +// 3. Title case +func allCases(r rune) []rune { + return []rune{unicode.ToLower(r), unicode.ToUpper(r), unicode.ToTitle(r)} +}