Uh, this got me pretty confused because the information that i got about this topic was structured in such a dumb way, first explaining that the comparison between reference types is done only by their addresses using the operator '=='(all this was posted in bold with explanation about 4 pages long). On top of that, all the examples were given by strings, but there was not a single word about any value equality between them. So, after posting here, I decided to finish the whole chapter on the case and 3 pages later(actually the last sentence on the last page) stated that there is a different behaviour for the '==' when using it to compare strings. Absolutely idiotic.
So, just for a final check, to be sure that i have got the info right:
'==' used on strings first checks if the both variables reference to the same object. If not, does an actual value comparison in the content itself.
Using string constants as the: bool isEqual = (a == "somethingNew"); for comparison will actually get the constant value, search for it in the so called pool and if it has a match, it will put a reference to the same object? So, it actually assign it as a variable? Sorry, this is still a little unclear for me.
And the last one(an example from the given article):
string firstString = "deer";
string secondString = firstString;
string thirdString = "de" + 'e' + 'r';
cw(firstString == secondString); // True - same object
cw(firstString == thirdString); // True - equal objects
cw((object)firstString == (object)secondString); // True
cw((object)firstString == (object)thirdString); //False
Shouldn't in this case the value of thirdString be searched for in the pool and the whole variable to receive a reference to the same object as firstString and secondString?