C# 中的 Char.ConvertFromUtf32(Int32) 方法
C# 中的 Char.ConvertFromUtf32(Int32) 方法用于将指定的 Unicode 码点转换为 UTF-16 编码的字符串。
语法
以下是语法 −
public static string ConvertFromUtf32 (int utf32);
上述参数 utf32 是 21 位 Unicode 码点。
示例
现在我们来看一个示例来实现 Char.ConvertFromUtf32(Int32) 方法 −
using System; public class Demo { public static void Main(){ int utf = 0x0051; string str = Char.ConvertFromUtf32(utf); Console.WriteLine("Value = "+str); } }
输出
这将生成以下输出 −
Value = Q
示例
现在我们来看另一个示例 −
using System;
public class Demo {
public static void Main(){
int utf = 0x0046;
string str = Char.ConvertFromUtf32(utf);
Console.WriteLine("Value = "+str);
}
}输出
这将生成以下输出 −
Value = F
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP