I have a problem with the following code. I cut the String "Data1", give it to "Data2" and then I check the String. My Phone always says "ab is not ab", but I do not know why? -.-
Any ideas?
String Data1 = "abc";
String Data2 = "";
Data2 = Data1.substring(0, 2);
if(Data2 == "ab")
{
Toast.makeText(this, Data2 + " is ab" , Toast.LENGTH_LONG).show();
}
else
{
Toast.makeText(this, Data2 + " is not ab", Toast.LENGTH_LONG).show();
}
Thanks ...