Equals(Object) method overrides the Object. Equals(Object) method to return true for any two string instances that contain the same characters in the same order. The following example shows how to override the Object. Equals(Object) method to test for value equality.