c# 类型 char , string
// 创建控制台应用程序文件:MyString.cs
Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CSType
{
public class MyString
{
public MyString()
{
char c = '1';
Console.WriteLine(c.GetType());
//output System.Char
string s = "2";
Console.WriteLine(s.GetType());
//output System.String
Console.ReadLine();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CSType
{
public class MyString
{
public MyString()
{
char c = '1';
Console.WriteLine(c.GetType());
//output System.Char
string s = "2";
Console.WriteLine(s.GetType());
//output System.String
Console.ReadLine();
}
}
}