How to check if a tag name contains something.

I have this pick up script and the following line that doesn’t work:

(objectToPickup.tag != "Carryable" | objectToPickup.tag != "Meat")

So I decided to use a different method:
Making the tag names Carryable Meat, Carryable Vegetables etc. and checking if the tag names contain the word “carryable”.
How do I go about to doing this?

Any help is appreciated.

Try this out :

void OnCollisionEnter(Collision collision)
{
        if (collision.gameObject.name.Contains("Carryable"))
        {

        }
}

Use tags for general category only. E.g. “collectible”
Add that one general tag to everything you can collect.

Thus you might want this instead of yours.

Create a script “itemPrefs” with a collectible info: name, cost, whatever else you need.
On collision, reference the script with all info you want, from the collided collectible.

That will spare you the hassle of 1000 tags.