string直接分成char数组

string直接分成char数组, 然后逐个输出来~

  1. using System; 
  2. using System.Collections.Generic; 
  3. using System.Linq; 
  4. using System.Text; 
  5.  
  6. namespace ConsoleApplication1 
  7.     class Program 
  8.     { 
  9.         static void Main(string[] args) 
  10.         { 
  11.             string s = Console.ReadLine(); 
  12.             Console.WriteLine("字符 ---------- 十进制"); 
  13.             for (int i = 0; i < s.Length; i++) 
  14.             { 
  15.                 char c = s[i]; 
  16.                 Console.WriteLine("  {0}  ----------   {1} ",c,(int)c); 
  17.             } 
  18.         } 
  19.     } 

string直接分成char数组