Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: String Manipulation Question


From   Alan Neustadtl <alan.neustadtl@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: String Manipulation Question
Date   Fri, 5 Aug 2005 16:46:53 -0400

Okay, I'm stumped after searching through the manuals.  I have a
string variable that has the name of a group.  For example, "Stata
Users Group" (stored without the quotes).

I want to create a new variable that 1) trims the string, 2) adds " as
a prefix, and 3) adds" as a suffix.

In other programs you could do something like this:

generate newname='"'+trim(name)+'"'

That is, enclose the double quotes in single quotes.

Can anyone direct me to the relevant portions of the manuals or know the answer?

TIA,
Alan

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index