比如str1.Split('_');就必须用单引号,双引号不能用。为什么?
解决方案 »
- DataGridView 选择状态
- C#程序显示文本的问题,内详。。
- 求助,相同数据压缩的问题
- 如何固定GRID单元格的焦点
- 请问高人 以下的代码如何改能对exchange邮件服务器发送?
- borderstyle问题
- 关于数据类型转换问题
- 如何读取一个txt就删除刚刚读取的txt
- 一个C#的重载操作符问题!!
- Winform上的各个控件与数据(例如DataSet)的绑定什么时候进行?
- 在c#或mshtml中有没有和script交流的类呀,比如在WebBrowser中于获取script返回的信息(和script传过来的图片)?
- 用RapidTier生成的sqlhelper不知道怎么获取存储过程返回的值
双引号是string
两个不同的东西
using System.Collections.Generic;
using System.Linq;
using System.Text;namespace CharStringType
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine('_'.GetType().ToString());
Console.WriteLine("_".GetType().ToString());
Console.ReadKey();
}
}
}控制台输出:
System.Char
System.String
双引号是string
两个不同的东西
也就是说 string s = 'abcd';
是不可以的 需要 sring s="abcd";我是小菜鸟! 说的不好清见谅, 希望能够帮到你!
双引号是string类型
假如要存放abcd
char型数组就是内存中就是存放了abcd
但是string类型在内存中多存了一个\0,用于表示字符串结束,即abcd\0