Created
May 25, 2022 16:16
-
-
Save KirillOsenkov/f982fcb5f506eedc4342494eebb6e526 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool CanConvertToHex(object value) | |
{ | |
return value switch | |
{ | |
byte or sbyte or ushort or short or uint or int or ulong or long or IntPtr or UIntPtr => true, | |
_ => false | |
}; | |
} |
thomaslevesque
commented
May 25, 2022
Nice! Why did I not think of this
or IntPtr or UIntPtr
or nint or nuint
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment