I think of myself as an advanced Stata user, but I just cannot figure out how to make the compound quotes work for me.
I have two macros, each containing compound quoted lists like `"name with space"' `"nospace"'. I can't figure out how to treat those chunks of string as space-separated lists.
If I create a local with no quotes, it looks like a list separated by a space. E.g.,
local test a b
. di "`test'"
a b
But if I put them in compound quotes, I get something very different:
. local test `"a"' `"b"'
. di "`test'"
a' invalid name
r(198);
. di `"`test"'
ab
This is a problem if I want to have chunks of strings treated as individual items, as below:
local set1 `"name with space"' `"nospace"'
. di `"`set1'"'
name with spacenospace
How can I make the macro be a list of string chunks (with or without spaces), separated by spaces? I'd ultimately like to iteratively build up such a macro and use it to name rows in a matrix.