Command Reference : Function Reference : Function Reference: W
  
 
@word
Single word from a string list.
Syntax: @word(str_list, n)
str_list: string
n: integer
Return: string
Returns the n-th element from the string list str_list, not including surrounding double-quotes. This function is the same as the @wordq function, but removes quotes.
Examples
@word("I don’t think so", 2)
returns the second element, “don’t”.
@wordq("""Chicken Marsala"" ""Beef Stew""", 2)
returns the second element, “Beef Stew”, without the surrounding double-quotes.
If ALPHA1 is an alpha series,
alpha str1 = @word(alpha1, 3)
returns the third word of the string lists in ALPHA1, while
alpha str2 = @word(alpha1, ser1)
returns the word in the string lists in ALPHA1 given by the integers in the series SER, for each observation in the workfile sample.
If SVEC1 is an string vector,
svector str3 = @word(svec1, 5)
returns an svector with the fifth word in each element of SVEC1”.
Cross-references
See also @wordq.