Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: removing "first letters"


From   [email protected]
To   [email protected]
Subject   Re: st: removing "first letters"
Date   Tue, 25 Apr 2006 13:45:26 -0700 (PDT)

try the -substr- function:

gen newvarname = substr(original_variable, 5, .)

briefly, generate a new variable equal to the contents of the original
variable, minus the first four characters (e.g. the "www.").

type -findit substr- for more information.

hope this helps,
clint

> Hi,
> I have a variable with web addresses and all the entries in this variable
> start with "www.". Is there an easy way of removing the "www." from the
> beginning of all entries?
> Thanks!
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today - it's FREE!
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
> *
> *   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/
>


*
*   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/



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