文字格式帮助 [英] text format help

查看:74
本文介绍了文字格式帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当我使用这样的文本字符串时:

Hi,

when I use text string like this:

string kk = "test \x26#39; ok";


输出为:


the output is:

test ' ok



但是当我尝试这个时:



but when I try this:

short val = 26;
string kk "test " + " \x" + val.ToString();


?

推荐答案

纳蒂,

Hi Nati,

short val = 26;

用十进制表示,
而x26为十六进制.翻译成十进制会
是38(2x16 + 6).因此,将38分配给val,就一切就绪.

干杯

曼弗雷德(Manfred)

is in decimal,
whereas x26 is hexa decimal. Translated to decimal it would
be 38 (2x16 + 6). So assign 38 to val and you''re all set.

Cheers

Manfred


这篇关于文字格式帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆