Nick Cox wrote:
What is happening is that -- when v3 is a string variable and not empty
--
replace v3 = subinstr(v3, "", "", 1)
zaps v3. That is, -v3- ends up empty.
I am not sure why that is happening. For example, replacing empty
strings by empty strings looks like an example of no change to me. Also
even if "" is a substring of a non-empty string, it still has a
complement.
--------------------------------------------------------------------------------
That's not good. Although it leaves a missing value in its wake, its messing up
of the string variable might go unnoticed, especially if the user expected
occasional blanks for other reasons.
It seems like something for StataCorp to remedy before others get bit during
activities like Rose's. In the interim, I guess the best protection is to
get into the habit of using -assert- liberally.
Joseph Coveney
*
* 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/