String.Format for Hex

后端 未结 5 1439
星月不相逢
星月不相逢 2020-12-14 05:52

With below code, the colorsting always gives #DDDD. Green, Red and Space values int he How to fix this?

string colorstring;
int Blue = 13;
int Green = 0;
int         


        
5条回答
  •  自闭症患者
    2020-12-14 06:45

    You can also pad the characters left by including a number following the X, such as this: string.format("0x{0:X8}", string_to_modify), which yields "0x00000C20".

提交回复
热议问题