I'm working with Lists and list functions and I'm having difficulty figuring out how to locate the exact text contained in a list. For example, in the following nameList I would like to create another list if the nameList contains the exact text specified in the variable "name". However, the Contains function doesn't obtain just the value specified in the variable "name". Any ideas why the creation of the act_nameList locates Jane in addition to what was requested (Jane_2) but doesn't locate Jane_3? This seems like odd behavior and I can't figure out how to create a list containing just the text specified in variable name. Any ideas or suggestions would be appreciated.
name = "Jane_2";
nameList = {“Jane”, “Louise”, “Katie”, “Jane_2”, "Becky", "Jane_3"};
act_nameList = {};
For( i = 1, i <= N Items( nameList ), i++,
If( Contains( name, nameList ),
Insert Into( act_nameList, nameList )
)
);
Show( act_nameList );