Doubt about ChartSymbol() comparison

 
Hello,

refactoring my code I've found a place where instead of comparing two symbols with StringCompare, I was doing == of both ChartSymbol(chartID). Suposedly ChartSymbol() returns a string and when comparing two strings if == is used, only returns true if both string are pointing to the same object. The thing is that I'm getting the coorrect outcome so I was wondering if is just luck and I should always use StringCompare or is because same symbols returns a string that points to the same object. Because depending on that, I can use == that seems more efficient as StringCompare compares char by char and == compares two pinters.

Thank you.
 
Victor: comparing two strings if == is used, only returns true if both string are pointing to the same object.
Wrong. It returns true if, and only if, the strings are identical.
Victor: . The thing is that I'm getting the coorrect outcome so I was wondering if is just luck and I should always use StringCompare
The results are identical, because they are identical operations.
 
William Roeder #:
Wrong. It returns true if, and only if, the strings are identical. The results are identical, because they are identical operations.
Oh thank you. I didn't see anything in the string documentation so I supposed it would be like other OOP languages.
William Roeder #:
The results are identical, because they are identical operations.
I don't understand it. Maybe I expressed it wrong. If I have ChartSymbol(chartID1)==ChartSymbol(chartID2) they are not identical operations, are they? They might get me the same result but the identifiers are different.