Command Reference : Function Reference : Function Reference: W
  
 
@wintersect
Intersection of words in two string lists.
Syntax: @wintersect(str_list1, str_list2)
str_list1: string
str_list:2 string
Return: string
Returns the elements that are in both str_list1 and str_list2. This function is case-sensitive.
 
Examples
 
 
@wintersect("John and Greg won", "Greg won with Mark's help")
returns the string “Greg won”.
Since this function is case-sensitive,
@wintersect("John and Greg won", "greg won with Mark's help")
just returns the string “won”.
If ALPHA1 and ALPHA2 are alpha series,
alpha stinter = @wintersect(alpha1, alpha2)
returns the intersection of values for elements of ALPHA1 and ALPHA2 for each observation in the workfile sample.
If SVEC1 and SVEC2 are string vectors,
svector stinter = @wintersect(svec1, svec2)
returns an svector containing the intersection of the elements in SVEC1 and SVEC2 for each element of the svectors.
Cross-Reference
See also @wcross, @winterleave, and @wunion.