STATA:字符串处理函数收集


length("asdf")
//检测字符串长度

//*命令 subinstr(S1,S2,S3,n),n表示迭代的次数,S1是变量,S2是需要替代的变量,S3是新替换的变量。如果n是.代表所有的都换*/
//reverse()字符串逆顺
local wjm="`c(current_time)'`c(current_date)'"
local wjm=subinstr(subinstr("`c(current_time)'`c(current_date)'",":","",.)," ","",.)
disp reverse("`wjm'")

 

posted @ 2023-03-05 09:23  myrj  阅读(268)  评论(0编辑  收藏  举报