开发者

convert 10 digit number to hex string

开发者 https://www.devze.com 2023-01-29 20:42 出处:网络
How do I convert a 10 digit number to a hex string in c#? Note: if the number is less than 10 digits, I want to add 开发者_如何学编程padding? example

How do I convert a 10 digit number to a hex string in c#?

Note: if the number is less than 10 digits, I want to add 开发者_如何学编程padding? example the number is 1, I want my string to be 0000000001.


Use a standard format string:

string paddedHex = myNumber.ToString("x10");

See the x format specifier.

0

精彩评论

暂无评论...
验证码 换一张
取 消