Added a function to generate a slice of all values (inclusive) in a range

This commit is contained in:
2025-01-27 16:00:26 -05:00
parent dec6aaca93
commit ae76e2e55e

View File

@@ -133,6 +133,13 @@ func genRange[T character](start, end T) []T {
return toRet
}
// Generate numbers in a range - start to end (both inclusive)
func genRangeInclusive[T character](start, end T) []T {
toRet := genRange(start, end)
toRet = append(toRet, end)
return toRet
}
// Returns a rune-slice containing all possible cases of the given rune.
// At the moment, this includes:
// 1. Upper case