Good afternoon,
I would like to create a categorical variable from a string variable composed by several and heterogeneous words.

Is there a Stata command that works in this way (see below)?

example:

Code:
if X contains "a word that could be in the string " gen = y
Many thanks in advance for your time.