There actually is a third way. You can use the formatter import tanto.text.convert.Format; int x = 37; char[] y1 = Format( "{} = 0x{:X4}", x ); // "37 = 0x0025"