Convert number to Hex-string C#
Section: .NET GeneralRating: Not rated yet!

Add to YiGGAdd to google-bookmarksAdd to linkarenaAdd to redditAdd to del.icio.usAdd to misterwongAdd to digg




Introduction

A snippet to convert an Int32-value to a Hex-string. To use it, you have to add a reference to the assembly Mircosoft.VisualBasic which contains some nice shortcuts for such functionalities.

/// <summary> /// Converts an Int32 value to hex-string /// </summary> /// <param name="value">input</param> /// <returns>Hex-string</returns> /// <example> /// string s = IntToHex(19988); /// s is 4E14 /// </example> private static string IntToHex(Int32 value) { return Microsoft.VisualBasic.Conversion.Hex(value); }




 Reader-Comments: