Is there something better than System.Byte.Parse("0xAA") to get a single byte on F# and C# ?
So the question is on title
I'm making System.Byte.Parse("0xAA") but I feel like every-time compiler parse the string and I want just send this byte to compiler.
I know there are F# literals ( for example 86uy ) but I want exactly hex mode. Maybe I can开发者_开发知识库 write AAuy but I can't understand how I can write it and 86uy in the same time. Because for example 11uy and 11uy (in hex mode) is different // correct me if I wrong.
Thank you.
If you want to write a byte constant in hex, just do 0xAAuy
.
See F# literals from MSDN.
You mean something like this?
// Valid C#
byte x = 0xAA;
(For the F# part, see Henning's answer.)
精彩评论