William P O'Sullivan wrote:Try this ... It does work! ;)
The OP asked about
if i create string using new operator
. In that context (which I thought is what you were answering), it doesn't work at all.
And even in the context you posted, I wouldn't call it "working." The OP wants to compare the contents of 2 Strings. The code you posted doesn't do that. It happens to produce the same result for that particular case, but I don't call taht "working".