Added a function to generate a slice of all values (inclusive) in a range
This commit is contained in:
7
misc.go
7
misc.go
@@ -133,6 +133,13 @@ func genRange[T character](start, end T) []T {
|
|||||||
return toRet
|
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.
|
// Returns a rune-slice containing all possible cases of the given rune.
|
||||||
// At the moment, this includes:
|
// At the moment, this includes:
|
||||||
// 1. Upper case
|
// 1. Upper case
|
||||||
|
Reference in New Issue
Block a user