static void Main(string[] args)
{
string a="liu";
string b="li";
Swap<string>(ref a,ref b);
Console.WriteLine("{0},{1}",a,b);
}
public static void Swap<T>(ref T a, ref T b)
{
T c ;
c = a;
a = b;
b = c;
}
有用
最新推荐文章于 2024-04-12 13:58:13 发布