Answers for "c# intptr to hex"

C#
1

C# int to hex

int num = 123;
//X can be capital and not capital it specifies if the hex characters should be upper or lowercase
//the number specifies the amount of hex characters
//2X will give you something like A5
string hex = num.ToString("X2");
Posted by: Guest on April-18-2020
0

c# string to hex

byte[] ba = Encoding.Default.GetBytes("sample");
var hexString = BitConverter.ToString(ba);
hexString = hexString.Replace("-", "");
Posted by: Guest on January-03-2022

C# Answers by Framework

Browse Popular Code Answers by Language