Greg,
if("String".replace('g','G') == "String".replace('g','G'))
System.out.println("Equal");
else
System.out.println("Not Equal");
if("String".substring(2,4) == "String".substring(2,4))
System.out.println("Equal");
else
System.out.println("Not Equal");
if("String".concat("s") == "String".concat("s"))
System.out.println("Equal");
else
System.out.println("Not Equal");
if("String ".trim() == "String ".trim() )
System.out.println("Equal");
else
System.out.println("Not Equal");
I ahve tested all the above, all prints "Not Equal" so it means, the methods substring,replace, trim and concat are creating new instances behind the scenes!
Is this seem good?