13,825
社区成员
发帖
与我相关
我的任务
分享
int n = 0x50;
int a = n >> 4;
int b = n & 0x0F;
ShowMessage(a);
ShowMessage(b);
int n = 0x50;
String str = IntToHex(n, 2);
String str1 = str.SubString(1, 1);
String str2 = str.SubString(2, 1);
ShowMessage(str1);
ShowMessage(str2);
String str9 = "9";
String strF = "F";
int n9 = ("0x" + str9).ToIntDef(0); // n9值为0x09
int nF = ("0x" + strF).ToIntDef(0); // nF值为0x0F
String strA = IntToHex((n9 + 1) & 0x0F, 1); // strA值为"A"
String str0 = IntToHex((nF + 1) & 0x0F, 1); // str0值为"0"