User Tools

Site Tools


tips:java:zeropaddedhex

Quickly convert a char to a zero padded hex string

Integer.toHexString(0x100 | (int) '\f').substring(1).toUpperCase(); // '\f' (linefeed) is '0C' in hex
tips/java/zeropaddedhex.txt · Last modified: 2009/06/08 12:10 by erik