Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: number of words in a text list


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: number of words in a text list
Date   Mon, 11 Jul 2005 21:59:02 +0100

Eric seems to invoke here a common misconception, the 
idea that -version #- sets the clock back 
to version #. 

As it happens, -wordcount()- was introduced
in Stata 8, as was documented in its [U] 1.3.13.9. 

If the misconception were really true, then 
-version 1- would certainly disable e.g.
Windows features, which long postdate version 1. 

What -version- does is set the clock back very 
selectively in respect of key capabilities. 

In this case, what is of much longer pedigree is 

local n : word count "<string>" 

which may be what Florence wants. 

Nick 
[email protected] 

Eric G. Wruck
 
> I found it in Stata 9.0 by typing <help word> & then by 
> clicking on <string functions>.  Apparently, wordcount() has 
> been around since Stata 1 as I was able to use it in a little 
> .do file that specified version 1.  In the new Stata manuals 
> flip to page 173 of the Data Management manual.
 
> >>How about the wordcount() function.  Here's an example:

> >>>also, is there a way to count how many WORDS are in a 
> string without making a loop to go through the string and 
> check that way ( I want something faster).

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