int在C#中的char [英] Int to Char in C#

查看:130
本文介绍了int在C#中的char的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是转换一个int值到相应的字符在UTF16的最好方式,因为int是在有效值范围?


解决方案

 (炭)敏;

例如:

  Console.WriteLine((char)的122 {0}(焦)122);

收益率:


  

(char)的122为z


What is the best way to convert an Int value to the corresponding Char in Utf16, given that the Int is in the range of valid values?

解决方案

(char)myint;

for example:

Console.WriteLine("(char)122 is {0}", (char)122);

yields:

(char)122 is z

这篇关于int在C#中的char的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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