本文介绍了将字符串数组元素复制到C#中的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有以下代码;

string test1 = words [2]; //" Exclud"

string test2 =" Exclud";

string test3 = String.Copy(words [2]); //" Exclud"


bool booTest1 = test1.Equals(test2); // false

bool booTest2 = test2.Equals(" Exclud"); // true

bool booTest3 = test1.Equals( " Exclud"); // false

bool booTest4 = words [0] .Equals(" Exclud"); // false

bool booTest5 = test3.Equals (Exclud); // false

bool booTest6 = test1.Equals(test1); // true


尽管test1 =Exclud这是从字符串arrray单词复制[],

比较时显示test1!=" Exclud"


有人可以帮我这个?


***通过开发人员指南 ***



I have the following code;
string test1 = words[2];//"Exclud"
string test2 ="Exclud";
string test3 = String.Copy(words[2]);//"Exclud"

bool booTest1 = test1.Equals(test2);//false
bool booTest2 = test2.Equals("Exclud");//true
bool booTest3 = test1.Equals("Exclud");//false
bool booTest4 = words[0].Equals("Exclud");//false
bool booTest5 = test3.Equals("Exclud");//false
bool booTest6 = test1.Equals(test1); //true

Though test1 = "Exclud" which is copied from string arrray words[],
when compared it shows that test1 != "Exclud"

Can some one please help me with this?

*** Sent via Developersdex http://www.developersdex.com ***

推荐答案





这篇关于将字符串数组元素复制到C#中的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 07:10