ds,has(type string) foreach i in `r(varlist)'{ egen t=sum(strpos(`i',"Total")) if !t drop `i' drop t } --- *设nation中的字符串全部为大写 g c=(strpos(nation,"C")>0) --- keep if strpos(x,"丹红")>0 如果我只想让字符串的前两个字是“丹红”,这样改如何写呢? keep ...