如何在DotNet中连接两个unicode字符并且没有任何空格?
当我连接以下两个 unicode 字符时,我会看到两个字符,但它们之间有一个空格。有没有办法摆脱这个空间?
StringBuilder sb = new StringBuilder();
int characterCode;
characterCode = Convert.ToInt32("2758", 16);
sb.Append((char)characterCode);
characterCode = Convert.ToInt32("25c4", 16);
sb.Append((char)characterCode);
When I concatenate the following two unicode characters I see both but there is a space between them. Is there anyway to get rid of this space?
StringBuilder sb = new StringBuilder();
int characterCode;
characterCode = Convert.ToInt32("2758", 16);
sb.Append((char)characterCode);
characterCode = Convert.ToInt32("25c4", 16);
sb.Append((char)characterCode);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果你检查 sb,你会发现它的长度为 2。字符之间没有空格。
我认为问题是你希望 2 个字符的“on”像素更接近其他所以这两个“角色”看起来更“相邻”,不是吗?
编辑:就像你说的,你可以看看这两个角色看起来是否“更接近”彼此使用不同的字体。
If you examine sb, you will see that it has Length of 2. There is no space between the characters.
I think the issue is that you wish the "on" pixels of the 2 characters were closer to each other so the 2 "characters" look more "next to" each other, no?
Edit: Like you said, you can see if those 2 characters look any "closer" to each other in a different font.
行不通
?
Would not
work?
没有空格,这是显示字体的产物。
There's no space, it's an artifact of your display font.
字符 U+2758 在 MS Gothic 中看起来很宽,但在 Arial Unicode MS 中看起来很窄。尝试改变你的字体。
Character U+2758 looks very wide in MS Gothic, but it's narrow in Arial Unicode MS. Try changing your font.