FOLLOW US
4dots Software CODE BLOG
VEGAS Movie Studio

How to Convert HEX to String

To convert an HEX string (hexademical string) to its normal format you can do the following :
VEGAS Movie Studio
	

	public string HexToString(string enctxt)
	{ 	
		// you can use here your desired encoding
		Encoding enc = System.Text.Encoding.UTF8;                                

        string hexString = enctxt.Replace(" ","");
	   
		var bytes = new byte[hexString.Length / 2];
		
		for (var i = 0; i < bytes.Length; i++)
		{
			bytes[i] = Convert.ToByte(hexString.Substring(i * 2, 2), 16);
		}

		string str = enc.GetString(bytes);
		
		return str;
	}

Music Maker - Free Full Version

 

Please Donate!