Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: find and replace strings in a variable
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: find and replace strings in a variable
Date
Fri, 3 Aug 2012 10:02:01 -0500
replace v1 = "International" if strpos(v1, "International") == 1
On Fri, Aug 3, 2012 at 9:57 AM, Mauricio Esteban Cuak
<[email protected]> wrote:
> Dear Statalisters,
>
> I have a variable called v1 that has different strings.
> One of the possible values for v1 comes with different spellings:
> "International: [4]", "International_[2,3]"
> They all have "International", however, and no other value has that string.
>
> I'd like to replace all those different spellings with just "International".
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/