Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Does -strpos()- return the second occurrence of a string?


From   Pedro Nakashima <[email protected]>
To   [email protected]
Subject   st: Does -strpos()- return the second occurrence of a string?
Date   Sat, 20 Apr 2013 11:54:51 -0300

Dear users

I'm looking for a way to identify the position of a string, which is
not the first.

For example, when we use-strpos () - to find the underscore "_" in the word:

ab_cd_ef

The function strpos () will return 3. But I wanted to return the
position of the second occurrence, 6.

Does anyone know a way to deal with this problem?

Best regards,
Peter
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index