Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Another question regarding string variables


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Another question regarding string variables
Date   Thu, 28 Feb 2013 08:20:05 +0000

Yes. For example

replace fullname = substr(fullname, 1, length(fullname) - 2) if
substr(fullname, -2, 1) == "  "

Nick

On Thu, Feb 28, 2013 at 6:41 AM, Dudekula, Anwar <dudekulaan@upmc.edu> wrote:

> Is it possible to trim last word if it is one alphabet wide like removing. A from   ( Graham , Tony   A )
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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