Method Equals
Equals(Object)
It compares the object with the tag and returns true if is equal, otherwise it will return false.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Object must be of type Tag. |
Returns
Type | Description |
---|---|
System.Boolean | True/False. |
Overrides
System.Object.Equals(System.Object)
Examples
The following example compares multiple tags.
Tag tag1 = new Tag("Alpha");
Tag tag2 = new Tag("Beta");
if (tag1.Equals(tag2))
{
Console.WriteLine("Tags are same");
}
else
{
Console.WriteLine("Tags are not same");
}