C#中的Convert.ToUInt64方法
使用Convert.ToUInt64()方法将指定的值转换为64位无符号整数。
以下是我们的字符。
char ch = 'a';
现在,让我们将其转换为64位无符号整数。
ulong res; res = Convert.ToUInt64(ch);
这是完整的示例。
示例
using System;
public class Demo {
public static void Main() {
char ch = 'a';
ulong res;
res = Convert.ToUInt64(ch);
Console.WriteLine("Converted char value '{0}' to {1}", ch, res);
}
}输出结果
Converted char value 'a' to 97