C# 的單引號和雙引號在宣告變數時,有不同的意思。
單引號表示字元(Char)
char c = 't';
雙引號表示字串(String)
string s = "test";
EX: 判斷文字是否含有字母 t
for (int i = 0; i < s.length;i++)
{
if ( s[i] == 't')
{
// S 含有字母t
}
}
C# 的單引號和雙引號在宣告變數時,有不同的意思。
http://msdn.microsoft.com/zh-tw/library/x9h8tsay.aspx
http://msdn.microsoft.com/zh-tw/library/362314fe.aspx
http://msdn.microsoft.com/zh-tw/library/ms228362.aspx