标签:style blog color io ar div sp log on
1 public static string CompareExchange( 2 ref string location1, 3 string value, 4 string comparand 5 )
用locationl与comparand进行比较,如果相等,那么locationl的值就是value的值;如果不等locationl的值就不变。函数等同于一下函数(简单模拟):
1 static string CompareExchange(ref string location1, string value, string comparand) 2 { 3 if(location1==comparand) 4 { 5 location1 = value; 6 } 7 return value; 8 }
标签:style blog color io ar div sp log on
原文地址:http://www.cnblogs.com/zhangyuanbo12358/p/3961815.html