char


C#字符和ASCII码互转

废话不多,直接上代码。 static void Main(string[] args) { char[] charFucks = new char[] { 'f', 'u', 'c', 'k' }; foreach (var item in charFucks) { Console.Write(Convert.ToInt32(item) + " "); } Console.WriteLine(); int[] asciiFucks = new int[] { 102, 117, 99, 107 }; foreach (var item in asciiFucks) { Console.Write((char)item); } …