Feedback

C# - ASCII to Hex

Veröffentlicht von am 10/4/2007
(1 Bewertungen)
Converted an ASCII-Text to an String with Hex-Values.
/// <summary>
/// Helper-Method
/// Converted an ASCII-Text to Hex-Value
/// </summary>
/// <param name="i_asciiText">ASCII-Text</param>
/// <returns>String with Hex-Representation</returns>
private String convertAsciiTextToHex(String i_asciiText)
{
	StringBuilder sBuffer = new StringBuilder();
	for (int i = 0; i < i_asciiText.Length; i++)
	{
		sBuffer.Append(Convert.ToInt32(i_asciiText[i]).ToString("x"));
	}
	return sBuffer.ToString().ToUpper();
}

Abgelegt unter ASCII, Hex.

Kommentare zum Snippet

 

Logge dich ein, um hier zu kommentieren!