Statalist


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

RE: RE: RE: RE: st: RE: problems on the string functions


From   "Joseph Coveney" <jcoveney@bigplanet.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: RE: RE: RE: st: RE: problems on the string functions
Date   Sun, 22 Nov 2009 14:43:47 +0900

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/



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