For example, I want to construct a local called name with several names in it:
Code:
local name D. Trump M. Spence N. Pelosi
Of course, Stata will take it as six persons whose names are "D." "Trump" and so on. One way to aviod this problem is to substitude the inner blank with _ , e.g. D._Trump, but this contradicts with traditions. I also tried an alternative method:
Code:
local name "D. Trump" "M. Spence" "N. Pelosi"
It turned out that the first person, who names D. Trump, was treated by Stata as D. and Trump, but the rest members were treated correctly. Is there any solution to this problem? Thanks!
The below is the full code and the result:
Code:
local name "D. Trump" "M. Spence" "N. Pelosi"
foreach s of local name{
      disp "`s'"
}

local len: word count `name'
disp `len'
Array