hex string to int csharp

Code Example - hex string to int csharp

                
                        string hex = "142CBD";
// this returns 1322173
int intValue = int.Parse(hex, System.Globalization.NumberStyles.HexNumber);
                    
                
 

csharp string to hex

                        
                                byte[] ba = Encoding.Default.GetBytes("sample");
var hexString = BitConverter.ToString(ba);
hexString = hexString.Replace("-", "");
                            
                        
 

Related code examples