| 
    
 |   | 
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: RE: RE: Substring command
Thank you Nick. 
It now works perfectly. 
Ilaria
-----Oorspronkelijk bericht-----
Van: Nick Cox [mailto:[email protected]] 
Verzonden: 20 April 2006 13:34
Aan: [email protected]
Onderwerp: st: RE: Substring command
-subinstr()- is a function, not a command. 
What you should do is use the correct syntax. 
-subinstr()- needs four arguments, not three. 
replace code = subinstr(code, "-", "", .) 
Nick 
[email protected] 
Mosca, Ilaria
 
> I have a string variable that looks like the following: 100-2555
> 500-2341
> 564-5213
> I would like to generate another variable that takes away the dash. In
> other words, the new variable would be the following:
> 1002555
> 5002341
> 5645213
> 
> I tried with the command  --replace code = subinstr(code,"-","") But I
> obtain an "invalid syntax r(198)" message.
> 
> What should I do?
*
*   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/
Met inachtneming van eventuele beperkende bepalingen in deze e-mail, mag u deze informatie gebruiken voor het doel waarvoor u die ontvangt. Aan deze gegevens kunnen geen rechten worden ontleend. CTG/ZAio aanvaardt geen aansprakelijkheid voor de juistheid en volledigheid van deze gegevens. Enige schade, ontstaan door de ontvangst of het gebruik van dit e-mailbericht of de informatie daarin, komt voor uw eigen verantwoordelijkheid. Als u een officiele beslissing (besluit, beslissing op bezwaar) van het CTG/ZAio wilt waaraan rechtsgevolgen verbonden zijn is een e-mailbericht onvoldoende. U dient dan een schriftelijke en ondertekende brief of fax te sturen met daarin het verzoek of bezwaar.
*
*   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/