gpt4 book ai didi

c# - 右填充箭头 "►"的ASCII码是什么

转载 作者:行者123 更新时间:2023-12-04 16:22:02 26 4
gpt4 key购买 nike

我正在尝试在 C# 中打印右填充箭头 ► 这是我尝试过的

 static void Main(string[] args) {
Console.WriteLine((char)16);
}

但它显示输出为 ?(问号)我经历了this也有问题,但它似乎不起作用。你能帮我提供显示正确输出的正确 ASCII 代码吗?

最佳答案

您可以轻松地将 char 转换为 int,从而获得其代码:

  char arrow = '►'; // Copy + Paste from the question

Console.Write($"{arrow} : {(int)arrow} : \\u{(int)arrow:X4}";);

结果:

  ► : 9658 : \u25BA

这就是为什么你可以把

  char arrow = '\u25BA';

关于c# - 右填充箭头 "►"的ASCII码是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59658872/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com