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: subinstr and special characters ? and *
From
A Loumiotis <[email protected]>
To
[email protected]
Subject
st: subinstr and special characters ? and *
Date
Fri, 13 Aug 2010 13:25:15 +0300
Hi,
Is there a way to use subinstr to replace a pattern that is given with
the special characters ? or * with something else?
For example:
local a p_2_3456
local b: subinstr local a "_?_" "__"
di "`b'"
local b=subinstr("`a'","_?_","__",1)
di "`b'"
I would expect that b will now be p__3456 but subinstr does not
recognize _?_ to include _2_ .
Is there anyway to do this?
Thanks,
Antonis
*
* 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/