using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TestString
{
class Program
{
static void Main(string[] args)
{
string a = "hello";
string b = "h";
b +="ello";
string c = "hello";
if ((object)a == (object)b)
{
Console.WriteLine("True");
}
else
{
Console.WriteLine("False");
}
if ((object)a == (object)c)
{
Console.WriteLine("True");
}
else
{
Console.WriteLine("False");
}
}
}
}
.net(关于字符串的相等问题[比较重要])
本文讨论了C#中字符串操作和比较的基本概念,包括字符串拼接、类型转换和使用`object`进行比较的方法。

被折叠的 条评论
为什么被折叠?



