诠释为十六进制字符串 [英] int to hex string
本文介绍了诠释为十六进制字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要转换和int以十六进制字符串
I need to convert and int to hex string.
1400 => 578
使用的ToString(X)
或的ToString(X2)
,但我需要像 0578
。
when converting 1400 => 578
using ToString("X")
or ToString("X2")
but I need it like 0578
.
任何人都可以向我提供的IFormatter以确保字符串有4个字符长?
Can anyone provide me the IFormatter to ensure that the string has 4 chars long?
推荐答案
使用的ToString(X4)
。
四指字符串会4位长
参考:的十六进制(X)格式MSDN上符。
这篇关于诠释为十六进制字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文