How to get a vector 3 to vector 2 - c#

I need help getting a Vector 3 to a Vector 2 or another method on using a vector 2 and 3 in a if statement

All the documentation says is:

Vector2.Vector2
Parameters
Description
Converts a Vector3 to a Vector2.
Vector3s can be implicitly converted to Vector2 (z is discarded).

^ This makes no sense to me.

Here’s my code so you can understand what I’m trying to do:

using UnityEngine;
using System.Collections;

public class CubeScript : MonoBehaviour {

    public GameObject cube;

    Touch userTouch = Input.GetTouch(0);

    // Use this for initialization
	void Start () {
        cube = GameObject.Find("Cube");
	}
	
	// Update is called once per frame
	void Update () {
        if (userTouch.position == cube.transform.position;) //this is underlined red
	
	}
}

Thanks in advance.

For conversion in C# you can write something like this:

Vector2 some2DVector = (Vector2) transform.position;

Just type Vector2 in parenthesis in condition just after operator.

if (userTouch.position == (Vector2) cube.transform.position)
{
   // do something (insert semicolon here, at the end of instruction)
}

However, you made a mistake. You mustn’t write semicolon in condition because this is not a instruction.