C#中char、byte、string

1294 ワード

var str = " ";
var str1 = "abc";
char[] chars = str.ToCharArray();
char[] chars1 = str1
.ToCharArray();
byte[] bytes = Encoding.Default.GetBytes(chars);
byte[] bytes1 =
Encoding.Default.GetBytes(chars1);
var newStr = Encoding.Default.GetString(bytes);
 : chars  char[5] { ' ', ' ', ' ', ' ', ' ' }
    chars1 char[3] { 'a', 'b', 'c' }
    bytes byte[10] { 206, 210, 202, 199, 214, 208, 185, 250, 200, 203 }
    bytes1 byte[3] { 97, 98, 99 }
    newStr " "


  1、 char , byte
  2、 char 1 , byte 2 , 1
  3、
  4、 byte ascii