Added functions to find if a character is a valid hex value and a valid octal value

master
Aadhavan Srinivasan 3 days ago
parent fcdb4a8868
commit b81a2f8452

@ -131,3 +131,11 @@ func expandSlice[T any](slc []T, newSize int) []T {
copy(toRet, slc)
return toRet
}
func isHex(c rune) bool {
return slices.Contains([]rune("0123456789abcdefABCDEF"), c)
}
func isOctal(c rune) bool {
return slices.Contains([]rune("01234567"), c)
}

Loading…
Cancel
Save