如何在字符串后附加字符. [英] How can I append characters for a string .

查看:61
本文介绍了如何在字符串后附加字符.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我必须附加< STX>字符转换为字符串.我该怎么做?
STX是一个特殊字符. (http://zh.wikipedia.org/wiki/Control_character)[/EDIT]

感谢和问候

Hello ALL,

I have to append <STX> character to string.How shall i do these?
STX is a special character. (http://en.wikipedia.org/wiki/Control_character) [/EDIT]

Thanks and Regards

推荐答案

您阅读或搜索了多少书?

如果需要再次添加到字符串或将字符串放在一起称为串联".谷歌中一个简单的"STX字符"给了我十六进制值. (对这是特殊代码的事实进行说明可能会有所帮助,我首先以为您打算添加标签< STX>"))

回答您的问题.
我认为以下方法可以解决问题,至少可以帮助您:
How much did you read or search yourself?

Adding to strings or putting string together is called ''concatenation'' in case you need it again. A simple ''STX character'' in google gave me the hex value. (An elaboration on the fact that this is a special code could have been helpful, I first thought you meant to add a tag "<STX>")

To answer your question.
I think the following should do the trick or at least get you on the way:
int stxval = 0x02; //found this value on wikipedia
string mystring;

StringBuilder builder = new StringBuilder(mystring);
mystring.Append(stxval);



我在此处找到了十六进制值 [ ^ ]

希望对您有所帮助.



I found the hex value here[^]

hope this helps.


在这里查看 http://www.hendricksongroup.com/code_003.aspx [ ^ ]


这篇关于如何在字符串后附加字符.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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