For example, X is a variable
X
123
234
35
67
82
Now the values are saved as strings. If I want to create a new variable Y where
Y = 1 if X contains the number 2
Y = 0 if otherwise
How to do this on STATA?