Added functions to find if a character is a valid hex value and a valid octal value
This commit is contained in:
8
misc.go
8
misc.go
@@ -131,3 +131,11 @@ func expandSlice[T any](slc []T, newSize int) []T {
|
|||||||
copy(toRet, slc)
|
copy(toRet, slc)
|
||||||
return toRet
|
return toRet
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func isHex(c rune) bool {
|
||||||
|
return slices.Contains([]rune("0123456789abcdefABCDEF"), c)
|
||||||
|
}
|
||||||
|
|
||||||
|
func isOctal(c rune) bool {
|
||||||
|
return slices.Contains([]rune("01234567"), c)
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user