0

I want to create a local macro (phrases) that stores a number of phrases:

"I'm sorry"
"I can help"
"so what"

Evidently, some of these phrases have apostrophes in them and I do not know how to store them.

I have tried the following:

local phrases " `I'm sorry' "
local phrases `" `"I'm sorry"' "'
local phrases ` "I'm sorry" '
local phrases `" "I'm sorry" "'

However, none of these seem to work; Stata will not accept the phrase as a single string.

trinitysara
  • 175
  • 1
  • 8

1 Answers1

1

The following works for me:

local foo `" "I'm sorry" "'

display `"`foo'"'
 "I'm sorry" 

clear
set obs 1

generate foo = `"`foo'"'

list

     +---------------+
     |           foo |
     |---------------|
  1. |  "I'm sorry"  |
     +---------------+